Objective-C: looking inside NSDictionary
For whatever reason the data structure browser doesn't work for me when using method arguments. You can, however, print it to the debugger console by right-clicking on it in the debugger window:
![[Image: upshot_printToConsole.png]](http://upshot.fsdev.net/upshot_printToConsole.png)
You can also use various debugger commands in the console, which behaves using the current context for the breakpoint:
From this context, you can also use more advanced things, even call methods:
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.
HTH.
![[Image: upshot_printToConsole.png]](http://upshot.fsdev.net/upshot_printToConsole.png)
Code:
Printing description of info:
<CFBasicHash 0x5a51420 [0x17c93e0]>{type = immutable dict, count = 2,
entries =>
0 : <CFString 0xcbae8 [0x17c93e0]>{contents = "username"} = <CFString 0x5a582f0 [0x17c93e0]>{contents = "*******"}
2 : <CFString 0xcbba8 [0x17c93e0]>{contents = "password"} = <CFString 0x5a35de0 [0x17c93e0]>{contents = "*******"}
}
(gdb)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.
HTH.
| Messages In This Thread |
|
Objective-C: looking inside NSDictionary - GregX999 - Nov 29, 2010, 01:51 PM
RE: Objective-C: looking inside NSDIctionary - cmiller - Nov 29, 2010 02:16 PM
RE: Objective-C: looking inside NSDictionary - GregX999 - Nov 29, 2010, 05:56 PM
|

