title: iOS: Can't save file to 'Application Support' folder, but can to 'Documents'
body: <p>I can download and save a binary file to the 'Documents' folder with a custom name perfectly fine.</p>
  <p>If I just change the URL to the 'Application Support' folder instead of the 'Documents' folder, it fails to write to that URL saying it doesn't exist.</p>
  <p>Here's the URL construction code:</p>
  <pre><code>- ( NSURL * ) getSaveFolder
  {
      NSURL * appSupportDir    = nil;
      NSURL * appDirectory     = nil;
      NSArray * possibleURLs   = [[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSAllDomainsMask];
      
      if ( [possibleURLs count] &gt;= 1 )
      {
          appSupportDir = [possibleURLs objectAtIndex:0];
      }
  
      if ( appSupportDir != nil)
      {
          NSString * appBundleID = [[NSBundle mainBundle] bundleIdentifier];
          appDirectory           = [appSupportDir URLByAppendingPathComponent:appBundleID];
      }
  
      return appSupportDir;
  }
  </code></pre>
  <p>Here's the saving code:</p>
  <pre><code>- ( void ) writeOutDataToFile:( NSData * )data
  {
      NSURL * finalURL = [self.rootPathURL URLByAppendingPathComponent:self.aFileName];
  
      [data writeToURL:finalURL atomically:YES];
  }
  </code></pre>
  <hr />
  <p>If I change the NSArray to:</p>
  <pre><code>NSArray * possibleURLs   = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask];
  </code></pre>
  <p>then it saves fine.</p>
  <p>I've read the Apple Docs on File stuff and can't fix this - what am I missing?</p>