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
.
精彩评论