on the launch of my app, it copies a library from my resources folder to the documents directory on the iOS device. This is a one time process on the first launch and never touched again. Apple today rejected my app with the following:
We found that your app does not follow the iOS Data Storage Guidelines, which is not in compliance with the App Store Review Guidelines.
The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., should be backed up by iCloud.
Temporary files used by your app should only be stored in the /tmp directory; please remember to delete the files stored in this location when the user exits the app.
Data that can be recreated but must persist for proper functioning of your app - or because customers expect it to be available for offline use - should be marked with the "do not back up" attribute. For
NSURLobjects, add theNSURLIsExcludedFromBackupKeyattribute to prevent the corresponding file from being backed up. ForCFURLRefobjects, use the correspondingkCFURLIsExcludedFromBackupKeyattribute.
I am not sure how to set up the do not backup attribute or whether it is what I need. Can anyone tell me how this is done based on my code?
-(void) progress
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentPath = ([documentPaths count] > 0) ? [documentPaths objectAtIndex:0] : nil;
NSString *dataPath = [documentPath stringByAppendingPathComponent:pathWeSet];
if (![fileManager fileExistsAtPath:dataPath]) {
NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
NSString *dataPath = [bundlePath stringByAppendingPathComponent:pathWeSet];
timer = [NSTimer timerWithTimeInterval:0.4 target:self selector:@selector(updateProgressView) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
[timer fire];
if (dataPath) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[fileManager copyItemAtPath:dataPath toPath:dataPath error:nil];
});
}
}
}
Thanks