For debugging purposes, I’d like to display as much class information as I can, and possibly runtime information (which thread does the class/function run in, etc) into the console.
Is there an easy way to do this with a function, variable or even (external) framework?
P.S: I’m using Cocoa Touch.
in a class, if you overload the
-(NSString *)descriptionmethod, you can easily log class info withNSLog(@"%@", some_object);here’s a fictitious example:
You can use standard C macros to get things like name, file, line number etc…
use the NSThread classes to get information about what thread the method is being called on.
I posted this one to twitter. http://twitter.com/kailoa/status/1349928820 Feel free to follow me if you are interested in more tidbits like this. I try to put them up regularly.