iOS 整型转换警告"NSInteger' should not be used as format arguments; add an explicit cast to 'long' inste"
来源:互联网 发布:淘宝售后服务评论 编辑:程序博客网 时间:2024/05/21 09:40
苹果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)];
1 0
- iOS 整型转换警告"NSInteger' should not be used as format arguments; add an explicit cast to 'long' inste"
- iOS之整型转换警告Values of type 'NSInteger' should not be used as format arguments;
- ios学习之路(知识点)Values of type 'NSInteger' should not be used as format arguments...
- IOS警告:Property access result unused - getters should not be used for side effects
- enum should not be used as an identifier since it is a reserved keyword from source level 1.5 on
- Wildcard App IDs can not be used to create in House provisioning profiles.Please use an Explicit App
- 警告: git command could not be found. Please create an alias or add it to yo
- BigDecimal(double)” should not be used
- Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-c
- iOS中Data argument not used by format string的警告处理
- 警告The argument of type String[] should explicitly be cast to Object[] for the invocation of the vara
- java.lang.Integer can not be cast to java.lang.Long
- Why the "volatile" type class should not be used
- the `gets' function is dangerous and should not be used.
- SonarQube-Java规范之Atomic-".equals()" should not be used to test the values of "Atomic" classes
- Public interfaces should be used to configure virtual
- TextView can not be cast to ViewGroup
- The following types may not be used as proxies 异常
- 生成树和最小费用生成树以及Kruskal算法
- Oracle中as关键字
- Pentaho BI Server的启动过程详解(一)
- UITableView的编辑功能,UICollectionView
- 我的2016
- iOS 整型转换警告"NSInteger' should not be used as format arguments; add an explicit cast to 'long' inste"
- java注解
- mongodb的sum操作以及javaapi的实现
- Java 运算符大全
- 创业公司使用R语言搭建简单的数据分析系统
- Session学习
- HDU 2262 Where is the canteen 期望 + 高斯消元
- SSH之Java.lang.Exception: Socket bind failed:
- 哪种语言合适写爬虫程序