You can right-click any object variable (ObjC or Core Foundation) and select "Print Description to Console" (also in Run-> Variables View). This outputs the result to the obejcts -debugDescription method, which by default calls -description . Unfortunately, NSDictionary overrides this to create a bunch of internal data that you don't like at all, so in this particular case, craigbs solution is better.
Displayed keys and values ββalso use -description , so if you need useful information about your objects in collections and elsewhere, overriding -description is required. I usually implement it along these lines to fit the default implementation format of NSObject :
- (NSString *) description
{
return [NSString stringWithFormat: @ "<% @% p> {foo:% @}", [self class], self, [self foo]];
} Jens Ayton Sep 22 '08 at 9:55 2008-09-22 09:55
source share