title: applicationDidEnterBackground - How to save my user data
body: <p>A novice's question.</p>
  
  <p>I have one NotePageAppDelegate and one NotePageViewController. Simple. In my ViewController, I have defined a method to save the user data. It works perfectly if I click a button in my app which calls the method saveToDisk which is defined in my ViewController. </p>
  
  <pre><code>    -(IBAction) saveToDisk
  { // saves the file to the disk
  }
  </code></pre>
  
  <p>This works perfectly if I click my button. However, if I close the app (i.e. in the Simulator clicking the Home Button), I would like to automatically save the page. I thought this is rather straight forward, so I put this in my AppDelegate:</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *)application {
  
      NotePageViewController* controller = [NotePageViewController alloc];
  
      [controller saveToDisk]; 
  
      [controller release];
  
  }
  </code></pre>
  
  <p>However, this has no effect whatsoever. Have I forgotten to define something else? Or should this theoretically do the job if I press the Home Button in the Simulator?</p>
  
  <p>Thanks for your help!</p>