<分区>
我想在 objective-c 中将 int 转换为字符串,该怎么做。
我的代码。
for (i=0; i<=200; i=i+10) {
// here i want to convet the value of i into string how to do this
}
提前致谢。
<分区>
我想在 objective-c 中将 int 转换为字符串,该怎么做。
我的代码。
for (i=0; i<=200; i=i+10) {
// here i want to convet the value of i into string how to do this
}
提前致谢。
最佳答案
试试这个:
NSMutableString *myWord = [[NSMutableString alloc] init];
for (int i=0; i<=200; i=i+10) {
[myWord appendString:[NSString stringWithFormat:@"%d", i]];
//...
}
//do something with myWord...
[myWord release];
NSInteger
只是 32/64 位系统上 int
或 long
数据类型的 typedef
.
关于iphone - 如何将 NSinteger 转换为字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3821495/