简体   繁体   中英

Prevent app from backing up files in the documents folder?

I am not able the test my case, because I simply don't know when the synchronisation process of syncing files is triggered. Thats why I am asking this here. I have a lot of files and subfolders in my apps document folder and want to prevent from backup up these files in ICloud (which seems to be stupidly the default). Is it necessary to mark all these files with

MyFile.setResourceValue(NSNumber.numberWithBool(true), forKey: NSURLIsExcludedFromBackupKey, error: &err)

or is it good enough to only mark the root document folder once and all childs will also be marked with ExcludedFromBackup implicitely ?

u can use it for root directory only

Starting in iOS 5.1, apps can use either NSURLIsExcludedFromBackupKey or kCFURLIsExcludedFromBackupKey file system properties to exclude files and directories from backups.

In details look Technical Q&A QA1719

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM