title: iCloud and Core Data pre-filled database
body: <p>I have an app with a pre-filled .sqlite file that is copied into the user's Documents directory when the app is first opened. This file is 12.9MB. Twice now, my app has been rejected since changing target to iOS5 with this rejection note:</p>
  <blockquote>
  <p>Binary Rejected Apr 24, 2012 10:12 AM</p>
  <p>Reasons for Rejection:</p>
  <p>2.23 Apps must follow the iOS Data Storage Guidelines or they will be rejected</p>
  <p>Apr 24, 2012 10:12 AM. From Apple.</p>
  <p>2.23</p>
  <p>We found that your app does not follow the iOS Data Storage Guidelines, which is required per the App Store Review Guidelines.</p>
  <p>In particular, we found that on content download, your app stores 12.81 MB. To check how much data your app is storing:</p>
  <ul>
  <li>Install and launch your app</li>
  <li>Go to Settings &gt; iCloud &gt; Storage &amp; Backup &gt; Manage Storage</li>
  <li>If necessary, tap &quot;Show all apps&quot;</li>
  <li>Check your app's storage</li>
  </ul>
  <p>The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., may be stored in the /Documents directory - and backed up by iCloud.</p>
  <p>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.</p>
  <p>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 &quot;do not back up&quot; 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.</p>
  <p>For more information, please see Technical Q&amp;A 1719: How do I prevent files from being backed up to iCloud and iTunes?.</p>
  <p>It is necessary to revise your app to meet the requirements of the iOS Data Storage Guidelines.</p>
  </blockquote>
  <p>I have tried setting the &quot;do not back up&quot; attribute as recommended in the Data Storage Guidelines, but is was rejected again.</p>
  <p>I do not use iCloud in my app, and Settings &gt; iCloud &gt; etc. shows no usage at all.</p>
  <p>I cannot use the <code>Caches</code> or <code>tmp</code> directories as the database is modified by the user after creation.</p>
  <p>I seem to be between a rock and a hard place here with Apple not allowing this kind of app to function at all.</p>
  <p>Has anyone had this problem and managed to overcome it?</p>
  <p><strong>EDIT 17-5-12</strong>
  I still haven't managed to get this app approved yet. Has anyone managed to do this?</p>
  <p><strong>EDIT 1-7-12</strong>
  My app has just been rejected again for the same reason. I am at a loss as to what to do here, as surely it is a common use scenario.</p>
  <p><strong>EDIT 11-9-12</strong>
  App now approved - please see my solution below. I hope it can help someone else.</p>