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

Not aware of any GUI that displays NSUserDefaults, but I use this in my application delegate to see the settings at start up:

- (void)applicationDidFinishLaunching:(UIApplication *)application
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSLog(@"%@ DEFAULTS = %@", [self class], [defaults persistentDomainForName:[[NSBundle mainBundle] bundleIdentifier]]);
} 

I haven't done it but you should be able to execute a po (print object) command on the user defaults like so:

po [[NSUserDefaults standardUserDefaults] valueForKey:@"someKeyName"] 

I prefer to wrap my defaults in a custom class and create a description method that dumps the defaults.

You can use the "defaults" command line utility to examine the defaults exactly. Read the man page for details.


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()