views:

90

answers:

2

hi, i saw this post today: http://stackoverflow.com/questions/112796/how-to-view-contents-of-nsdictionary-variable-in-xcode-debugger. i need to see the contents of a dictonary but i only know the "key"...is there a way i can spit out the details like a print_r in php? po gives me the object, but i would like to go deeper

po 0x2027c0
NSCFDictionary
A: 

I don't know about mono, but when I, some time ago, took a look at Quake3 (written in C) in GDB, I had to do this

(gdb) print pak_checksums@9

To print out

static const unsigned pak_checksums[] = 
{
    1566731103u,
    298122907u,
    412165236u,  
    2991495316u,
    1197932710u,
    4087071573u,
    3709064859u,
    908855077u,
    977125798u
};

And the result was:

    $1 = {1566731103, 298122907, 412165236, -1303471980, 1197932710, -207895723, 
      -585902437, 908855077, 977125798}

[Real checksums changed for this example ;-)) ]

Quandary
A: 

In the Xcode debugger, right click on the dictionary in the debugger window and select "print description to console", or in the GDB console window, type print-object myDictionary where myDictionary is a reference to the dictionary you want to print e.g.

(gdb) print-object myDictionary
{
    bar = foo;
    biz = baz;
}
JeremyP