arm64 NSInteger 和 int (%d)不匹配
来源:互联网 发布:以大数据为主题的论文 编辑:程序博客网 时间:2024/05/17 22:13
2月份开始苹果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
修改方法如下:
NSInteger number = 0;
NSString *str = [NSStringstringWithFormat:@"%d",number];
假如number这个值32位足够了,
1、可以更改数字定义为int number = 0;
强转型
2、[NSStringstringWithFormat:@"%d",(int)number];
32位可能不够的话
3、[NSStringstringWithFormat:@“%ld",(long)number];
一般双击代码左边黄色标签,系统会默认弹出选择用第三种方法替换
4、[NSString stringWithFormat:@“%@", @(number)];
0 0
- arm64 NSInteger 和 int (%d)不匹配
- int和NSInteger区别
- NSInteger 和 int 区别
- nsinteger 和int
- int和NSInteger区别
- NSInteger 和int区别
- int和NSInteger区别
- NSInteger 和 int 区别
- int和NSInteger区别
- NSInteger和int
- NSInteger和int的区别
- NSInteger和NSUInteger,int区别
- int和NSInteger的区别
- 【ios】int 和 NSInteger区别
- int和NSInteger的区别(自Xcode5.1)
- NSInteger 与 NSUInteger 和 int与 NSInteger 区别
- NSInteger 与 NSUInteger 和 int与 NSInteger 区别
- NSInteger 与 NSUInteger 和 int与 NSInteger 区别
- I'm Back: CSDN密码被盗10天。
- 在框架中,如何实现退出全部界面方法
- 增加Windows远程桌面连接数量
- (DT系列一)DTS结构及其编译方法
- 反向代理谷歌
- arm64 NSInteger 和 int (%d)不匹配
- Python中一些小技巧
- 【Flume】【源码分析】flume中拦截器的源码分析,以TimestampInterceptor为例
- 黑马程序员-C语言总结
- docker容器的多应用开机启动
- ubuntu thrift 编译安装
- php图像处理函数大全(缩放、剪裁、缩放、翻转、旋转、透明、锐化的实例总结)
- 各种数据库取前10行记录
- 很二很牛逼