0

This one is odd - I can't see what is wrong with the code!

NSUserDefaults *userDefaults1 = [NSUserDefaults standardUserDefaults];
NSLog(@"ENTERING SETTINGS VIEW, SAVED CURRENCY IS: %@", [userDefaults1 stringForKey:@"userCurrency"]);

if ([[userDefaults1 stringForKey:@"userCurrency"] isEqualToString:@"EURO"]){
    NSLog(@"ENTERING THE IF");
         _currency.selectedSegmentIndex = 2;
}

I am trying to take the value of the NSUserDefault (which hs been previously saved as a string) and create an if statement to set up the view.

The output I from the logs is:

2013-11-10 17:17:49.948 APP[3433:70b] ENTERING SETTINGS VIEW, SAVED CURRENCY IS: EURO

and I get a Thread 1 breakpoint error when I try and compile... the NSLog suggests that the string is there... any ideas?

4

0 に答える 0