I am downloading many audio and video files and stored them in my Home directory. Now i want to "prevent backup to iCloud" so i have added following code for my every file's url
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}
Can anyone tell me that will this code work for all IOS versions. if not then please suggest the correct way to do this. Thank You