Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In case you want to submit for iOS versions 5.0.1 and above, use the below code. I don't think that you need to skip cache and tmp directory from iCloud backup coz iCloud doesn't care about these directories. </p> <pre><code>+(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)fileURL { // First ensure the file actually exists if (![[NSFileManager defaultManager] fileExistsAtPath:[fileURL path]]) { NSLog(@"File %@ doesn't exist!",[fileURL path]); return NO; } // Determine the iOS version to choose correct skipBackup method NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; if ([currSysVer isEqualToString:@"5.0.1"]) { const char* filePath = [[fileURL path] fileSystemRepresentation]; const char* attrName = "com.apple.MobileBackup"; u_int8_t attrValue = 1; int result = setxattr(filePath, attrName, &amp;attrValue, sizeof(attrValue), 0, 0); NSLog(@"Excluded '%@' from backup",fileURL); return result == 0; } else if (&amp;NSURLIsExcludedFromBackupKey) { NSError *error = nil; BOOL result = [fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&amp;error]; if (result == NO) { NSLog(@"Error excluding '%@' from backup. Error: %@",fileURL, error); return NO; } else { // Succeeded NSLog(@"Excluded '%@' from backup",fileURL); return YES; } } else { // iOS version is below 5.0, no need to do anything return YES; } } </code></pre> <p>If the data can be downloadable from Server,then instead of saving your downloaded files to the Documents directory save them to the Cache directory which is a temp directory that don't get backed up to iCloud and can be randomly deleted by the OS on certain occasions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload