开发者

warning: format not a string literal and no format arguments

When i run the below code

NSLog([NSString stringWithFormat:@"Response count is %d",response.pro开发者_开发百科ducts.count]);

i get a warning message like below

warning: format not a string literal and no format arguments

what is the problem in my syntax..


You don't need to create another autoreleased string, just pass it straight to NSLog:

NSLog(@"Response count is %d",response.products.count);

The reason why this warning is popping up is because you didn't supply a format string as the first argument to NSLog.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜