读书人

“format not a string literal and n

发布时间: 2012-09-17 12:06:51 作者: rapoo

“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 这是为什么 啊?

读书人网 >移动开发

热点推荐