small medium large xlarge

Back to: All Forums  Core Data
18 Aug 2011, 23:50
Paul Johnson (21 posts)

I get a compiler warning message for the NSLog() call: NSLog(@"%@:%s No model to generate a store from", [self class], _cmd); The complaint is apparently about “%s” being used to format the selector “_cmd”. If I try to cast _cmd as a string I get another warning that in the future this will be deprecated. This NSLog() call appears in Zarra’s book so I thought someone here can suggest something to remove the warning message.

25 Aug 2011, 17:57
Paul Johnson (21 posts)

To remove the compiler warning message, replace the NSLog call with: NSLog(@"%@:%@ No model to generate a store from", [self class], NSStringFromSelector(_cmd));

11 Dec 2011, 20:37
Marcus S. Zarra (284 posts)

What is the warning?

My current macro for this is:

@NSLog(@”%s(%p) Some Log Message”, PRETTY_FUNCTION, self)@

You must be logged in to comment