I have a class and I want to customize what is printed when I call NSLog with this class. For example,
NSLog (@ "% @", nonstandardObject);
How do I set up an object to print what I need?
Override the -description method. It takes no parameters and returns NSString that get printf 'd out.
-description
NSString
printf
Another option, called -debugDescription (returns an NSString , with no parameters), which is used when positioning an object from gdb.
-debugDescription