I have file – of arbitrary type including Core Data repositories – that I need to keep around and not have iOS delete them. Usually, I do not want iCloud to back these files up. Where should I save them?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Saving files locally changed from iOS5.0 and earlier, 5.0.1, and 5.1 and newer primarily to the address iCloud backup issues. There are two Apple source documents (the File System Programming Guide, and QA1719) that together provide the information supporting the following:
Files should be saved in the “Caches” directory, as there is no way to prevent backups if they are stored in the Documents folder. Note that the system may remove these files (see QA1719), so you would need the ability to recreate each as needed. To find the caches directory, use this:
Files should be saved in ‘/Library/Application Support’ (FSP, page 15), which can be better accessed via:
My experience is that this directory doesn’t always exist, and thus you may need to create it:
Files saved to this directory (or subdirectories) need an extended attribute to tell iCloud not to back them up (see QA1719).
PS: I have not found a way to set the Deployment target to this release, if there is a way please leave a comment.
Files (or folders of files) should be located in the ‘Application Support’ folder as described above. To prevent iCloud from backing up use:
as described in QA1719. Note that you can apply this key to a directory to prevent its contents from being backed up. The complete method from QA1719: