user198725878
user198725878

Reputation: 6386

warning: format not a string literal and no format arguments

When i run the below code

NSLog([NSString stringWithFormat:@"Response count is %d",response.products.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..

Upvotes: 1

Views: 503

Answers (1)

Jacob Relkin
Jacob Relkin

Reputation: 163268

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.

Upvotes: 6

Related Questions