转换为字符串

基本类型 / 数字 / 整型

int number = 42;

NSString *s1 = [NSString stringWithFormat:@"%i", number];
//s1 is "42"

NSString *s2 = [NSString stringWithFormat:@"%.3d", number];
//s2 is "042"