I have this simple code to save and restore boolean from NSUserDefaults. At the end when I do
po [defaults boolForKey:@"dummy"]
in the debugger I see nil.
What is going on here ?
// Store the data
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:(BOOL)boolValue forKey:@"dummy"];
[defaults synchronize];
BOOL ans = [defaults boolForKey:@"dummy"];
Where am I wrong ?
Thanks!
UPDATED: Thanks! Now clear