【发布时间】:2014-12-10 08:29:14
【问题描述】:
假设我有这个,int yo = 5;。
现在我想将其转换为 NSString。以下是可能的方法,
1) NSString *h = [NSString stringWithFormat:@"%d",yo];
2) NSString *k = @(yo).stringValue;
3) NSString *s = [NSNumber numberWithInt:yo].stringValue;
4) any other "best" ways?
哪个是最好的,为什么?
【问题讨论】:
标签: cocoa-touch nsstring type-conversion processing-efficiency memory-efficient