首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

“format not a string literal and no format arguments”处置

2012-09-17 
“format not a string literal and no format arguments”处理在XCode 3.2.1以后系统中开发时,如果使用:NSL

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

热点排行