iphone - Prevent files from being backed up to iCloud -
i want save file document
folder , don't want icloud backing up, saw can use method:
- (bool)addskipbackupattributetoitematurl:(nsurl *)url { assert([[nsfilemanager defaultmanager] fileexistsatpath: [url path]]); nserror *error = nil; bool success = [url setresourcevalue: [nsnumber numberwithbool: yes] forkey: nsurlisexcludedfrombackupkey error: &error]; if(!success){ nslog(@"error excluding %@ backup %@", [url lastpathcomponent], error); } return success; }
and want ask if need call every time create new file in document
folder?
whenever create file or folder should not backed up, write data file , call method, passing in url file. instead of it, can call method document folder once.
Comments
Post a Comment