Easy way to see saved NSUserDefaults?

Ethan picture Ethan · Nov 4, 2009 · Viewed 97.5k times · Source

Is there a way to see what's been saved to NSUserDefaults directly? I'd like to see if my data saved correctly.

Answer

marshn picture marshn · Dec 4, 2009

You can print all current NSUserDefaults to the log:

Just keys:

NSLog(@"%@", [[[NSUserDefaults standardUserDefaults] dictionaryRepresentation] allKeys]);

Keys and values:

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