首页 > 代码库 > Format string is not a string literal (potentially insecure)

Format string is not a string literal (potentially insecure)

Warning:  Format string is not a string literal (potentially insecure)

 

[objc] view plaincopy在CODE上查看代码片派生到我的代码片
 
  1. NSString * str = nil;  
  2.   
  3. str = [NSString stringWithFormat:@"---%d---", 18] ;  
  4.   
  5. NSLog(str);  

 

解决1:

 

[objc] view plaincopy在CODE上查看代码片派生到我的代码片
 
  1. NSLog(str,nil);  


解决2:

 

[objc] view plaincopy在CODE上查看代码片派生到我的代码片
 
    1. NSLog(@"%@", str);