Objective-C: looking inside NSDictionary

I've setup an NSMutableDictionary (named "availableStates") but I keep getting NIL when I try to retrieve an object using objectForKey.

So I stuck a break-point in the code and when I run/debug it, I look up in the "Variables" area and I can see that availableStates has 2 key/value pairs (which is correct). If I click the triangle to expand, it says "NSDictionary". If I click the triangle next to that, it says "NSObject". Expanding that triangle gives me "isa". Then I keep getting "isa" forever if I keep expanding the triangles.

So... how do I look inside the NSMutableDictionary to see what the key/value pairs actually are? (Or an NSMutableArray, or the non-mutable versions?)

You can also use various debugger commands in the console, which behaves using the current context for the breakpoint:

Code:

(gdb) po info
{
password = *******;
username = *******;
}

From this context, you can also use more advanced things, even call methods:

Code:

(gdb) po [info allKeys]
<__NSArrayI 0x588f090>(
username,
password
)

FWIW, your root problem is probably that you're mis-typing the key that you want. Using po [info allKeys] (replacing info with the name of your NS(Mutable)Dictionary, you should see the problem fairly quickly.