title: Writing files on iPhone
body: <p>I am going to store a .xml file on the iphone through an app I have made. I have written some code:</p>
  
  <pre><code>NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
  NSString *resPath = [documentsPath stringByAppendingPathComponent:@"FILENAME"];
  [MY_NSDATAREFERENCE writeToFile:resPath atomically:YES];
  </code></pre>
  
  <p>This works on simulator, however is this the correct way of saving files?</p>
  
  <p>I know you can't write to the application bundle, however which paths/places are valid to write and read information from.</p>
  
  <p>Any help much appriciated!</p>