Created
April 23, 2014 14:00
-
-
Save brocoo/11216259 to your computer and use it in GitHub Desktop.
This method should be implemented in a NSURL category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)addSkipBackupAttribute{ | |
if (![[NSFileManager defaultManager] fileExistsAtPath:[self path]]) return NO; | |
NSError *error = nil; | |
BOOL success = [self setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error]; | |
if(!success){ | |
NSLog(@"Error excluding %@ from backup %@", [self lastPathComponent], error); | |
} | |
return success; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment