title: NSUserDefaults. setValue works, Not setBool
body: <p>I trying to store some settings in NSUserDefaults, but It seems that the app won't store the setBool values. </p>
  
  <p>This works: </p>
  
  <p><code>[[NSUserDefaults standardUserDefaults] setValue: @"hello" forKey: @"test"];
   [[NSUserDefaults standardUserDefaults] synchronize];
  </code></p>
  
  <p>When I terminate the app and restart it, the value have been saved. However, when I do this:  </p>
  
  <p><code>[[NSUserDefaults standardUserDefaults] setBool: YES forKey: @"test"];
   [[NSUserDefaults standardUserDefaults] synchronize];
  </code>
  It won't save after I close the app and restart it. </p>
  
  <p>Should I file a bug report, or is there something I'm missing here?</p>
  
  <p>Thanks</p>
  
  <p>Edit: </p>
  
  <p>I figure what I did wrong. In AppDelegate, I wanted to check if the boolForKey was set, and it it wasn't I did this: </p>
  
  <pre><code>if (![defaults boolForKey: @"test123"])
  [defaults setBool: YES forKey: @"test123"];
  </code></pre>
  
  <p>... however, when it comes to boolWithKey, the "!" just check if the bool is YES or NO, not if its nil. </p>