title: NSFileManager createFileAtPath works in simulator but fails on device
body: <p>I am trying to write some image data to disk on iOS, but while it's working perfectly in the Simulator, when I try it on a real iPad it fails (returns 0).</p>
  
  <pre><code>BOOL success = [[NSFileManager defaultManager] createFileAtPath:filePath contents:imageData attributes:nil];
  </code></pre>
  
  <p>The path in question looks something like this: <code>/Library/Caches/_0_0_0_0_1100_1149.jpg</code> and I've also tried <code>/Documents/...</code>.</p>
  
  <p>Is there any way to actually get an error code or something beyond just success/fail?</p>