Xcode 警告信息处理:Format string is not a string literal (potentially insecure)
来源:互联网 发布:pp软件2015下载 编辑:程序博客网 时间:2024/05/21 06:54
NSObject *obj = @"A string or other object.";NSLog([NSString stringWithFormat:@"%@",obj]);// 有警告NSLog([NSString stringWithFormat:@"%@",obj],nil);// 解决方案
为何如此?
解答=>上面可以直接写成:
NSLog(@"A string or other object.");//或者NSObject *obj = @"A string or other object.";NSLog(@"%@",obj);//没有必要再调用 NSString的 stringWithFormat: 方法
===============================================================
注:警告信息:“Format string is not a string literal (potentially insecure)”说明NSLog要求的参数为字面量,不可为NSString* 类型,如:
NSString* s=...;NSLog(s) //警告//-------------------------NSLog([NSString stringWithFormat...]);//依旧警告
0 0
- Xcode 警告信息处理:Format string is not a string literal (potentially insecure)
- Format string is not a string literal (potentially insecure)
- 解决编译时出现的警告:format string is not a string literal (potentially insecure)
- 解决编译时出现的警告:format string is not a string literal (potentially insecure)
- format not a string literal and no format arguments
- format not a string literal and no format arguments
- format not a string literal and no format arguments
- error: format not a string literal and no format arguments
- format not a string literal and no format arguments
- format not a string literal and no format arguments
- error: format not a string literal and no format arguments
- String literal is not properly closed by a double-quote
- String literal is not properly closed by a double-quote
- error: format not a string literal and no format arguments [-Werror=format-security]
- :error: format not a string literal and no format arguments [-Werror=format-security]
- error: format not a string literal and no format arguments [-Werror=format-security];
- format not a string literal and no format arguments [-Werror=format-security]
- format not a string literal and no format arguments [-Werror=format-security]
- C# 制作软件启动画面
- [IOS]绑定事件时,为何看不到具体的UIControlEvents对象,只有事件委托?
- JS学习笔记(03)——(联动菜单,计时器)
- UIView的Touch事件UIControlEvents详解
- iOS 如何进行逆向工程?
- Xcode 警告信息处理:Format string is not a string literal (potentially insecure)
- Leetcode: Longest Substring with At Most Two Distinct Characters
- Chapter03 数组相关操作
- (8)python字符和数字初步接触
- Java类的访问权限
- Java中的堆和栈的区别
- 注意不可将控件的setTag方法与viewWithTag方法混淆
- Chapter04 映射和元组
- spark测试集群搭建