You can right-click any object (ObjC or Core Foundation) variable and select “Print Description to Console” (also in Run->Variables View). This prints the result the obejct’s -debugDescription
method, which by default calls -description
. Unfortunately, NSDictionary
overrides this to produce a bunch of internal data the you generally don’t care about, so in this specific case craigb’s solution is better.
The displayed keys and values also use -description
, so if you want useful information about your objects in collections and elsewhere, overriding -description
is a must. I generally implement it along these lines, to match the format of the default NSObject
implementation:
-(NSString *) description
{
return [NSString stringWithFormat:@"<%@ %p>{foo: %@}", [self class], self, [self foo]];
}