Hi all,
I've been browsing through a few Cocoa projects to see how other people do it.
I see a lot of a code like the following when using NSLog.
What's the advantage of that over what I use which is.
I was taught the former but started using the later because the output includes the full method declaration, and importantly for me includes the class where the method was defined. The former just outputs the message name.
I've been browsing through a few Cocoa projects to see how other people do it.
I see a lot of a code like the following when using NSLog.
Code:
NSLog(@"%@", NSStringFromSelector(_cmd));
What's the advantage of that over what I use which is.
Code:
NSLog(@"%s", __PRETTY_FUNCTION__);
I was taught the former but started using the later because the output includes the full method declaration, and importantly for me includes the class where the method was defined. The former just outputs the message name.