阅读背景:

指定某一个路径不备份到iCloud和iTunes

来源:互联网 
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{

    NSError *error = nil;
    BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
                                  forKey: NSURLIsExcludedFromBackupKey error: &error];
    if(!success){
        NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
    }
    return success;
}


分享到: