Unexpected results from NSUserDefaults boolForKey
<p>After uninstalling an application completely from the device and then loading it in the debugger, I am attempting in a setup method to load a flag using boolForKey. The first time the app runs I have the expectation that the bool will not exist, since I have just reinstalled the app. I expect from the documentation that boolForKey will therefore return NO. </p>

<p>I am seeing the opposite though. boolForKey is returning YES, which fubars my initial user settings. Any idea why this might be happening or a good way around it?</p>

<pre><code>BOOL stopAutoLogin = [[NSUserDefaults standardUserDefaults] boolForKey:@"StopAutoLogin"];
_userWantsAutoLogin = !stopAutoLogin;
</code></pre>

<p>So stopAutoLogin comes out as "YES", which is completely unexpected.</p>

<p>Stranger and stranger: When I call objectForKey:@"StopAutoLogin" I get a nil object, as expected. It's just the boolForKey that returns a bad value. So I changed the code to this:</p>

<pre><code>// this is nil
NSObject *wrapper = [[NSUserDefaults standardUserDefaults] objectForKey:@"StopAutoLogin"];

// this is YES
BOOL stopAutoLogin = [[NSUserDefaults standardUserDefaults] boolForKey:@"StopAutoLogin"];
</code></pre>
