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:
- 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.
- 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.
- 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.
- 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