IOS Data Storage

Source: Internet
Author: User

The app was rejected again because of iOS Data Storage

In order to distinguish clearly the role of the various directories in the sandbox, I went to see the Apple document, sandbox directory Introduction

Summary below:

Documents: Store user-generated data, such as user-downloaded video books, browsing records, etc. However, for resources that can be generated or re-downloaded in documents, it must be marked as a type that cannot be recovered by itunes (Nsurlisexcludedfrombackupkey) (meaning that the file is too large and dynamic and does not need to be backed up). The comparison of translation, look at the official words, their own experience under:

Remember. Files in Documents/and application Support/are backed up by default. You can exclude files from the backup by calling-[nsurl SetResourceValue:forKey:error:] using the Nsurlisexcludedfromback Upkey key. Any file, can be re-created or downloaded must is excluded from the backup. This is particularly important for large media files. If your application downloads video or audio files, make sure they is not included in the backup.

Specific methods:

// Tag folder is not recoverable from iTunes

< Span style= "COLOR: #000000" >            [[ nsurl urlwithstring: Resource setresourcevalue: @ ( yes

forkey:nsurlisexcludedfrombackupkey

error:nil];



Library/preferences: We don't need to create files ourselves, this directory is usually where the program uses NSUSERDEFAULTS to store data. itunes recovery is supported.


Library/caches: This directory can be used to store any file, including the user's data. Caches does not support itunes recovery after IOS2.2, and will be emptied when itunes resumes, IOS5 the system will empty the directory when the hard drive is tight. It is therefore prudent to store user data, preferably on documents.


TMP: Can be used to store temporary files when the program is running, the files need to be removed manually when they are no longer needed, of course, the system will be emptied periodically when the program is not running, and itunes recovery is not supported.



PS: Use of the students please order a praise



IOS Data Storage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.