Skip to content

Instantly share code, notes, and snippets.

@maximbilan
Created February 6, 2016 10:47
Show Gist options
  • Select an option

  • Save maximbilan/18a23acb854c003280e9 to your computer and use it in GitHub Desktop.

Select an option

Save maximbilan/18a23acb854c003280e9 to your computer and use it in GitHub Desktop.
iCloud Issue
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSArray *documents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:basePath error:nil];
NSURL *URL;
NSString *completeFilePath;
for (NSString *file in documents) {
completeFilePath = [NSString stringWithFormat:@"%@/%@", basePath, file];
URL = [NSURL fileURLWithPath:completeFilePath];
NSLog(@"File %@ is excluded from backup %@", file, [URL resourceValuesForKeys:[NSArray arrayWithObject:NSURLIsExcludedFromBackupKey] error:nil]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment