How to use NSURLIsExcludedFromBackupKey or kCFURLIsExcludedFromBackupKey?

My application was rejected because I save the purchase data in the application in the Documents folder on the iPhone.

Data that can be recreated, but must be saved for your application to work properly, or because clients expect it to be available for offline use, should be marked with the “do not back up” attribute. NSURLAdd an attribute for objects NSURLIsExcludedFromBackupKeyto prevent backing up the corresponding file. For objects, CFURLRefuse the appropriate attribute kCFURLIsExcludedFromBackupKey.

But I want the user to use the data, even if they are offline, so I will use kCFURLIsExcludedFromBackupKeyor NSURLIsExcludedFromBackupKey. What is the difference between the two?

The question is how to use any of them, and what will it return, and how can I use this returned data?

+3
source share
1 answer
NSError *error = nil;

BOOL result = [fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error];
+5
source

All Articles