title: iOS, will writeToFile:atomically:YES never fail?
body: <p>I'm writing a save game function for an iPad game, and really only need 1 savegame. However, I'm not sure if I should account for some kind of savegame corruption and use current/previous save in case one gets corrupted.</p>
  
  <p><strong>Can iOS device events,interrupt the atomic writing operation and leave my save in a corrupted state?</strong> I'm talking about stuff like device being turned off, multitasking, home button, phone calls,etc. I know that the definition of atomic means it should not, but I would like to make sure. </p>
  
  <pre><code>+(void)writeSaveGameData:(NSData*)data
  {
      if(data == nil)
      {
          return;
      }
       [data writeToFile:[SaveGame savegamePath] atomically:YES];
  
  }
  
  +(NSData*)saveGameData
  {
      return [NSData dataWithContentsOfFile:[SaveGame savegamePath]];
  }
  </code></pre>