Make sure your call to synchronize
after setting the value:
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"someKey"]; [[NSUserDefaults standardUserDefaults] synchronize];
Change response to comments:
From the documentation for -registerDefaults:
::
The contents of the registration domain are not written to disk; you need to call this method every time your application starts . You can put the plist file in the application resource directory and call registerDefaults: with the content you read in this file.
So, in -applicationDidFinishLaunching:
you can register your default Root.plist
values:
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Root" ofType:@"plist"]]];
chown source share