Since all objects inherit from NSObject, they all respond to the description method. Just override this method in your classes to get the desired result.
The description method in some Cocoa classes, such as NSNumber, calls the stringValue method internally. For example...
NSNumber *num = [NSNumber numberWithFloat:0.2f]; NSString *description1 = num.stringValue; NSString *description2 = [num description]; NSLog("%@", description1); NSLog("%@", description2);
... have the same output:
Printing description of description1: 0.2 Printing description of description2: 0.2
Pedro mancheno
source share