title: iPhone - How to detect if a key exists in NSUserDefaults standardUserDefaults
body: <p>Using <code>NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];</code>,</p>
  
  <p>I use calls like <code>BOOL boolFromPrefs = [defaults boolForKey:@"theBoolKey"];</code> To get a saved BOOL value. </p>
  
  <p>If the key is not found, NO is returned (default behaviour of boolForKey).<br>
  But... NO can be a saved setting. Same thing for <code>intForKey</code></p>
  
  <p>So how can I test if a key exists before trying to get its value ?</p>