title: iPhone and NSUserDefaults
body: <p>In my <em>viewWillLoad:</em> method I'm currently doing something along these lines:</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated {
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     if ( [defaults boolForKey:@"enabled_preference"] ) {
        ...   
     } else {
        ...   
     }
     [super viewWillAppear:animated];
  }
  </code></pre>
  
  <p>If I build and run the application before opening the preference pane (built using a normal <em>Settings.bundle</em>) then the bool seems to be <em>NO</em> (or more probably <em>nil</em>) rather than the default <em>YES</em>. However if I open the Settings application and look at the application preference pane before I open the application, everything works as expected. </p>
  
  <p>I'm presuming that the application preferences aren't initialized and I should initialise them to the default value (if not already set) in the application delegate. Can someone confirm this? Or am I missing something else blindingly obvious here?</p>