title: Excluding the Documents Directory from iCloud Backup
body: <p>Here is the code that I'm using right now, however, Apple still sent me the 'Rejection' notice:</p>
  
  <p><strong>didFinishLaunchingWithOptions:</strong></p>
  
  <pre><code>NSString *docsDir;
  NSArray *dirPaths;
  NSURL *finalURL;
  dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  docsDir = [dirPaths objectAtIndex:0];
  
  finalURL = [NSURL fileURLWithPath:docsDir];
  
  [self addSkipBackupAttributeToItemAtURL:finalURL];
  </code></pre>
  
  <p>I beg that you please do not redirect me to another Stack Overflow thread, I have tried six different methods now, all failed to work. :(</p>
  
  <p><strong>Edit: Added Rejection notice</strong></p>
  
  <pre><code>----- 2.23 -----
  
  We found that your app does not follow the iOS Data Storage Guidelines, which is required per the App Store Review Guidelines.
  
  In particular, we found that on launch and/or content download, your app stores 102.71MB. To check how much data your app is storing:
  
  - Install and launch your app
  - Go to Settings &gt; iCloud &gt; Storage &amp; Backup &gt; Manage Storage 
  - If necessary, tap "Show all apps" 
  - Check your app's storage
  
  The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., should be backed up by iCloud. 
  
  Temporary files used by your app should only be stored in the /tmp directory; please remember to delete the files stored in this location when the user exits the app.
  
  Data that can be recreated but must persist for proper functioning of your app - or because customers expect it to be available for offline use - should be marked with the "do not back up" attribute. For NSURL objects, add the NSURLIsExcludedFromBackupKey attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCFURLIsExcludedFromBackupKey attribute. 
  
  For more information, please see Technical Q&amp;A 1719: How do I prevent files from being backed up to iCloud and iTunes?.
  
  It is necessary to revise your app to meet the requirements of the iOS Data Storage Guidelines. 
  If you have difficulty reproducing a reported issue, please try testing the workflow described in Technical Q&amp;A QA1764: How to reproduce bugs reported against App Store submissions.
  
  If you have code-level questions after utilizing the above resource, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
  
  - complete details of your rejection issue(s)
  - screenshots
  - steps to reproduce the issue(s)
  - symbolicated crash logs - if your issue results in a crash log
  </code></pre>