2015-02月份开始苹果app必须支持arm64了,支持以后会有一个问题,
NSInteger变成64位了,和原来的int (%d)不匹配,会报如下warning,
Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead
解决方案:
1,假如number这个值32位足够了,可以更改数字定义为int 型;
2,强转型:[NSString stringWithFormat:@"%d", (int)number];
3、32位可能不够的话:[NSString stringWithFormat:@“%ld", (long)number];
4、[NSString stringWithFormat:@“%@", @(number)];
一劳永逸的办法:
在如下图所在的位置的相应的.m文件,双击文件, 在其中添加 -Wno-shorten-64-to-32 (这个关键在就是让编译器忽略 Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int32_t' (aka 'int') 警告)


关闭整个工程的这种警告:
工程的target有一个 Other Warning Flags ,在其中添加 -Wno-shorten-64-to-32,再重新编译,哈哈,整个工程中的这种警告全部消失了!!!!