How do I use a default setting from Root.plist?
Posted
by crooksy88
on Stack Overflow
See other posts from Stack Overflow
or by crooksy88
Published on 2010-03-21T09:17:44Z
Indexed on
2010/03/21
9:21 UTC
Read the original article
Hit count: 132
iphone
I have set up a default setting for my app using Root.plist, giving this a Boolean DefaultValue of YES (ticked checkbox).You can see a screengrab at http://www.infin8design.com/clients/stack/plist.png
However, when my app is first launched, the YES value is not picked up, and the setting is read as a NO (or 0). The user has to manually go into the settings app, turn the toggleswitch off, then turn it back on again for this setting to hold a YES(1) value.
I'm logging the value with appDidFinishLaunching like this.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"%d",[defaults boolForKey:@"include_phrases"]);
SO... my question is... How do I pick up this initial default setting without the user having to set it manually?
Thanks in advance for any suggestions you can offer.
Mark
© Stack Overflow or respective owner