iOS5 data storage issue. Where to save files?

懵懂的女人 提交于 2019-12-01 04:44:18

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.

Claus Broch

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.

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/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!