iOS 整型转换警告"NSInteger' should not be used as format arguments; add an explicit cast to 'long' inste"
2016-02-15 14:49
627 查看
苹果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、系统推荐方法 [NSString stringWithFormat:@“%ld”, (long)number];
2、强制转换 [NSString stringWithFormat:@”%d”, (int)number];
3、[NSString stringWithFormat:@“%@”, @(number)];
Values of type ‘NSInteger’ should not be used as format arguments; add an explicit cast to ‘long’ instead
解决办法:
1、系统推荐方法 [NSString stringWithFormat:@“%ld”, (long)number];
2、强制转换 [NSString stringWithFormat:@”%d”, (int)number];
3、[NSString stringWithFormat:@“%@”, @(number)];
相关文章推荐
- ios开发证书变成证 “此证书的签发者无效了”
- iOS 7中自动布局教程
- iOS-关闭应用时想让应用直接退出的方法
- IOS开发证书显示“此证书的签发者无效”解决方法
- IOS开发证书显示“此证书的签发者无效”解决方法
- IOS开发证书变成“此证书的签发者无效”解决方法
- iOS 设置label的边距
- ios-此证书的签发者无效
- iOS开发证书变成“此证书的签发者无效”解决方法
- iOS IM开发准备工作(二)protobuf-objc安装及使用
- iOS中Block总结
- IOS开发证书变成“此证书的签发者无效”解决方法
- 002、iOS开发-NSLog不打印设置
- 此证书的签发者无效
- iOS开发 证书失效解决办法
- iOS 整体框架类图
- iOS 7 的多任务
- GitHub上排名前50的iOS项目:总有一款你用得着
- iOS 滤镜效果
- iPhone/iOS开启个人热点的垂直适配问题详解