“format not a string literal and no format arguments”处理
在XCode 3.2.1以后系统中开发时,如果使用:
NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, ?error, ?[error userInfo]]);
格式输出日志,往往会出现“format not a string literal and no format arguments”警告。遇到这种情况时,只需把调用方式改成:
NSLog([NSString stringWithFormat:@"%@ %@, %@", errorMsgFormat, ?error, ?[error userInfo]], nil);
即可解决。
1 楼 qichunren 2011-09-25 这是为什么 啊?