How to view contents of NSDictionary variable in Xcode debugger?

In the gdb window you can use po to inspect the object.

given:

NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
[dict setObject:@"foo" forKey:@"bar"];
[dict setObject:@"fiz" forKey:@"buz"];

setting a breakpoint after the objects are added you can inspect what is in the dictionary

(gdb) po dict
{
  bar = foo;
  buz = fiz;
}

Of course these are NSString objects that print nicely. YMMV with other complex objects.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)