【发布时间】:2013-09-26 12:42:48
【问题描述】:
在 iOS 7 Sprite Kit 中
NSMutableArray *temp = [[NSMutableArray alloc] init];
int x = [temp count];
NSLog(@"%02d", x);
这个简单的例子会产生这个警告
隐式转换丢失整数精度:'NSUInteger'(又名 'unsigned long') 到 'int'
在标准应用项目中,完全相同的代码不会产生此警告。
这不是什么大问题,我可以用这个解决它
NSMutableArray *temp = [[NSMutableArray alloc] init];
NSUInteger x = [temp count];
NSLog(@"%02lu", x);
只是想知道为什么。
谢谢
【问题讨论】:
标签: ios warnings nsuinteger sprite-kit