I'm using NSUserDefaults for a Settings Application. This is a pristine copy and I have not at all added anything to the filesystem for this particular setting. I expect it to be nil, but on the contrary..
If I do something like the following:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ( [defaults valueForKey:kIdentifierKey] == nil ) {
return YES;
}
else {
NSLog(@"we have a value. return NO. Value is: %@", [defaults objectForKey:kIdentifierKey]);
return NO;
}
Yet in NSLog, nothing shows where you'd expect the value. The else block does indeed get executed. Is there any reason why this is NOT nil?