7

Firstly, I have read these:

(1) http://www.gaiagps.com/news/article/iOS5%20Breaks%20Data%20Storage%20and%20Crushes%20My%20Soul

(2) http://iphoneincubator.com/blog/data-management/local-file-storage-in-ios-5

(I can not submit more than two hyperlinks because I'm a noob.)

and all the related developer forum threads in apple.com.

Problem: with the new iOS5, we need to save files to /Caches folder, and save only user generated files to the /Documents folder. And caches folder may be deleted unexpectedly even when our app is not running, on app updates or system restores. The deletion at an unexpected time is the one that worries us.

The reason I am still opening a question about the same issue is to ask;

1. If I am missing anything. As if there's an update on this issue and I am the only one that didn't hear it. The guy from the first link (gaiagps) is complaining about having their app rejected and so, but his following blog post is telling their app data is now safe from deletion.

2. Is it okay to save my data to /Documents (even if they're big -to ruin the iCloud user experience-), using the new component UIDocument and syncing it with iCloud storage?

I would like to develop the app correctly to get accepted by the app review the first time I submit the app (if possible), to avoid any latencies. So what I am asking is, where to save the data in iPad so it won't get deleted?

typeiierror
  • 75
  • 1
  • 6

4 Answers4

2

There are a few key points to remember here...

  1. The documents directory is for files which cannot be easily recreated or downloaded. For instance, if an app downloads some common files to the users device, this should not go in the documents directory as it is not really specific to the user and can be easily re-downloaded.

  2. Items which are created specific to the user and which may be difficult to recreate should be stored in the documents folder, for instance a PDF which is created via user input or editing.

  3. Any files in the documents directory will be included in back-ups, whether that be to iTunes or to iCloud so storing overly large files in the documents directory is likely to upset your users.

Simon Lee
  • 22,304
  • 4
  • 41
  • 45
  • Thank you for the response. My app will be downloading PDFs, videos, etc. Files can be redownloaded, but problem is, it will not be in any way redownloadable when the user has no internet connection and wants to use the files that they have stored. The files will also be a lot, which will probably get rejected by app review because "it stores a lot of files to Documents". It is app that a company worker will use in order to show presentations to clients, thus they won't be complaining about the itunes sync. What they will complain about is when their downloaded data is deleted, unexpectedly. – typeiierror Nov 02 '11 at 09:47
  • Sadly the items you describe should be stored in the cache directory but as we know this is no longer as reliable as it previously was. I would **hope** that the OS is intelligent enough to **only** clear the cache directory when doing an iCloud backup and hence when the user has internet connectivity but being able to determine when you need to re-download is a big issue. :( – Simon Lee Nov 02 '11 at 09:49
  • I would check for internet connectivity on launch (and where you do not currently have the required files). The cache **may** disappear when the user is low on storage space, so when you launch and your files have gone, alert the user as to why and you should be good. – Simon Lee Nov 02 '11 at 09:53
  • That is a good way to get put the blame on Apple, but still, the case is, when the my application's user goes to a meeting to do a presentation (with the iPad), and the data is gone, and there's no internet connection present, would be devastating. – typeiierror Nov 02 '11 at 09:59
2

Apple has fixed this issue in iOS 5.01 beta.

See my blog post here:

http://www.gaiagps.com/news/article/Apple%20Fixes%20Issue%20that%20Affected%20Offline%20Mapping%20Apps%20in%20iOS%205.0

Andrew Johnson
  • 13,108
  • 13
  • 75
  • 116
1

You should only save user generated documents in the Documents folder. App generated data generally goes into a subdirectory of the Library directory or tmp for short lived data.

If you need to make sure your app generated data is not automatically purged you can use the "Application Support" directory.

A have provided a more detailed answer to a similar question here.

Community
  • 1
  • 1
Claus Broch
  • 9,212
  • 2
  • 29
  • 38
  • Thank you for the response. I have read from the apple forums that Application Support directory is also backed up by iCloud, which may also be a reason to be rejected because it may ruin the 'iCloud user experience'. – typeiierror Nov 02 '11 at 09:55
1

I had the same issue with my App and Apple rejected my app as I was storing my data into /Document directory;

Here are my findings which I documented in a blog post; http://aasims.wordpress.com/2012/02/02/storage-issue-with-ios-5-and-icloud/

Ans
  • 3,461
  • 3
  • 23
  • 24
  • 1
    Linking to a blog post is absolutely fine. But it would be helpful if you could summarize it here. Then even if your blog is no longer available for whatever reason, your answer does not become invalid. A summary would be fine, with further details in your blog. – Bart Feb 27 '12 at 12:49