iOS file storage path rules

Source: Internet
Author: User

Storing Your App ' s Data efficiently

Https://developer.apple.com/icloud/documentation/data-storage/index.html

Summary: User generated: Stored in documents, will be backed up to icloud

Programs generated: such as databases, downloaded cache images, stored in library/caches

Temporary files: Store again temp directory, run out remember delete

To ensure that backups is as efficient as possible, store your app ' s data according to the following guidelines:

  1. Only documents and other data which is user-generated, or so cannot otherwise be recreated by your application, should be stored in the <application_home>/documents directory and is automatically backed up by ICloud.
  2. Data that can is downloaded again or regenerated should be stored in the <application_home>/library/caches Direc Tory. Examples of files should put in the Caches directory include database cache files and downloadable content, such as th At used by magazine, newspaper, and map applications.
  3. Data is used only temporarily should are stored in the <application_home>/tmp directory. Although these files is not backed-to-iCloud, remember to delete those files if you do with them so that they Don't continue to consume space on the user's device.
  4. Use the ' do not ' back up ' attribute for specifying files, ' should remain on device, even ' storage situations. Use the attribute with data, can be recreated but needs to persist even in low storage situations for proper function ing of your app or because customers expect it to is available during offline use. This attribute works on marked files regardless of what directory they is in, including the Documents directory. These files won't be purged and is not being included in the user ' s ICloud or iTunes backup. Because These files do use On-device storage space, your app are responsible for monitoring and purging these files Periodi Cally.

iOS file storage path rules

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.