I save a bool value in NSUserDefaults like this:
[[NSUserDefaults standardUserDefaults]setBool:NO forKey:@"password"];
And then I synchronize defaults like this:
[[NSUserDefaults standardUserDefaults]synchronize];
But when my app enters background and then enters foreground my bool changes value to YES
Why does that happen ? I set my bool to YES only in one place in program, which is not managing when my app leaves/enters foreground.
Thanks!
Just perform a simple test where you are saving your bool as
see what’s the value..