tags:

views:

71

answers:

1

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

A: 

looks like you need to set the values that you want the key to take when the user switches the parameter on and off. Try adding the following to your plist:

TrueValue   String  YES
FalseValue  String  NO
kharrison
Thanks for your reply but unfortunately that didn't make any difference. Even though DefaultValue for this Boolean is ticked in the plist, on first launch of the app the value is being read as 0 or false.
crooksy88