I have a settings bundle in my iPhone app, with the following PList:
Type: PSMultiValueSpecifier
Title: Within (Kilometres)
DefaultValue: Number: 1
Titles: Array:
Item 1: Number: 1
Item 2: Number: 2
Values: Array:
Item 1: Number: 1
Item 2: Number: 2
Key: String: km
Then in my code i have:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSInteger choiceOne = [defaults integerForKey:@"km"];
choiceOne is always 0.
What am i doing wrong?
Thanks
Have you tried actually start Settings app and select the “Within” settings, then come back to the app to check? The app won’t take the default value automatically.
You can check if the key really exists with
Or just set the value to 1 if it’s outside of the expected range.