iphonexcodedebuggingnsuserdefaults

Can you see the values of NSUserDefaults anywhere in the xcode debugger?


Can you see the values of NSUserDefaults naywhere in the xcode debugger?

Just wondering if this is possible?

Thanks,

Nick


Solution

  • I don't have a solution to view them in the debugger, but I can offer this:

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSLog(@"%@", [defaults dictionaryRepresentation]);
    

    For some caveman-debugging:)

    EDIT: As David suggest in the comment, we can now do this in the debugging console:

    po [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]
    

    Swift 3.0

    po UserDefaults.standard.dictionaryRepresentation()