Original articles, reproduced please indicate the source
iOS project, if you have a built-in download or a program dynamically generated files, you should pay attention to the downloaded or generated files, do not automatically back up to icloud
If you do not have the right reason to upload large files automatically, you may not be able to pass the application audit. Received a reply like this
We also found that your app does not follow the IOS Data Storage guidelines, which is required per the app Store Review Gu Idelines.
For example, someone encounters the same problem Http://stackoverflow.com/questions/16239147/ios-do-not-back-up-attribute
Apple gives the Setup method: Official Document Https://developer.apple.com/Library/ios/qa/qa1719/_index.html
Apply to the project, the code is as follows
#define Download_directory "Download_dir" #pragma mark Download_dirvoid Deviceclass::initdownloaddir () {string L_ Strdocumentdir = Cocos2d::ccfileutils::sharedfileutils ()->getwritablepath (); L_strdocumentdir.append (download_directory); nsstring* L_strdownloaddir = [NSString stringWithUTF8String:l_strDocumentDir.c_str ()]; nserror* L_error; if (![ [Nsfilemanager Defaultmanager] fileexistsatpath:l_strdownloaddir] {[[Nsfilemanager Defaultmanager] CreateDirectory Atpath:l_strdownloaddir Withintermediatedirectories:no Attributes:nil error:&l_error]; Create folder//exclude downloads from ICloud backup nsurl *url = [Nsurl Fileurlwithpath:l_strdow Nloaddir]; if (strcmp (G_systemversion.c_str (), "5.1") >=0) {if ([url setresourcevalue:[nsnumber numberwithbool:yes] for Key:nsurlisexcludedfrombackupkey Error:&l_error] = = NO) {NSLog (@ "error:unable to exclude L_strdownloa Ddir from backup:%@ ", l_error); }}}//this->setdonotbackupinicloud ();} is to create a new folder in the writable directory, to store the download file (if necessary, automatically generated files are also placed here), and mark this directory will not be uploaded to icloud
Thank Mei Jun colleagues for their reminders
Test method:
Set up->icloud-> management storage (select Device if multiple devices are available)
For more apps, click "Show All Apps" to find your app and back up the total capacity of your content on icloud.
By opening and closing this interface, you will find that your app's backup MWJG capacity on icloud is not the same.