设置文件属性,使文件不进行iCloud备份
+ (BOOL)setSkipICloudBackupWithFileURL:(NSURL *)URL
{
if(![[NSFileManager defaultManager] fileExistsAtPath:[URL path]])
{
return NO;
}
NSError *error = nil;
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
forKey: NSURLIsExcludedFromBackupKey error: &error];
return success;
}
网友评论