NSUserDefaults always returns 0, in Simulator and Device
- by joec
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