iOS之整型转换警告Values of type 'NSInteger' should not be used as format arguments;
来源:互联网 发布:linux select串口 编辑:程序博客网 时间:2024/06/14 10:37
苹果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之整型转换警告Values of type 'NSInteger' should not be used as format arguments;
- ios学习之路(知识点)Values of type 'NSInteger' should not be used as format arguments...
- iOS 整型转换警告"NSInteger' should not be used as format arguments; add an explicit cast to 'long' inste"
- SonarQube-Java规范之Atomic-".equals()" should not be used to test the values of "Atomic" classes
- IOS警告:Property access result unused - getters should not be used for side effects
- Why the "volatile" type class should not be used
- BigDecimal(double)” should not be used
- enum should not be used as an identifier since it is a reserved keyword from source level 1.5 on
- iOS中Data argument not used by format string的警告处理
- Error: non-generic cannot be used with type arguments
- IOS警告imgName' used as the name of the previous parameter rather than as part of the selector
- 警告The argument of type String[] should explicitly be cast to Object[] for the invocation of the vara
- the `gets' function is dangerous and should not be used.
- java编程之Noncompliant; %n should be used in place of \n to produce the platform-specific line separato
- The following types may not be used as proxies 异常
- The following types may not be used as proxies
- the update-modules command is deprecated and should not be used
- warning: the `gets' function is dangerous and should not be used.
- 可能出现编码问题的地方
- 持久层 技术选型如何决策?JPA,Hibernate,ibatis(mybatis)
- 南邮 OJ 1963 带妹子去看电影
- C++格式化输出
- Leetcode #209 Minimum Size Subarray Sum
- iOS之整型转换警告Values of type 'NSInteger' should not be used as format arguments;
- UIScrollView 原理详解
- C语言一个二叉树的实现
- Android版本升级同时Sqlite数据库的升级及之前数据的保留
- 南邮 OJ 1964 NP
- 编程题目分类
- 文件IO 与 标准IO
- 文章标题
- win7系统安装sql server 2000 图解全过程