Note that NSUserDefaults.BoolForKey
returns NO
or false
if there is no settings for this key or if it is the first run of the application. It kinds of explains your problem, at least as far as I understood the problem.
Take a look on the Apple documentation:
boolForKey:
Returns the Boolean value associated with the specified key.
(BOOL)boolForKey:(NSString *)defaultName
Parameters
defaultName
: A key in the current user's defaults database.
Return Value
If a boolean value is associated with defaultName
in the user defaults, that value is returned. Otherwise, NO
is returned.