We're storing data into Document directory of application and we got rejection of application. We've tried with "do not back up" attribute for storing data in current version with below code.
- (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;
}
We've used it as per iOS Data Storage Guidelines.
In earlier version we've also tried with storing data in Private directory. But, we were not able to get approval of application.
Can you please give us some more description regarding why we are not able to get approval of application? or yet, we need any other changes in code regarding data storage? So, that we can get approval and we've new version of application on iTunes.
Have a look at this link http://developer.apple.com/library/ios/#qa/qa1719/_index.html#//apple_ref/doc/uid/DTS40011342 The code you are using is compatible for 5.0.1 and not 5.1 and later. You have to use Cache for <=5.0 . But the better solution would be to deploy for 5.1 and later instead of 5.0 because if you have large amounts of data, it is likely that the Cache will be cleared sooner of later. Hope it helps.
I think @Jasarien's comment is the right answer, but there was no further comm, and this question is relatively new, so I'll expand.
For others to see the rejection you get:
So I see why you would use "do not back up" and expect to be in compliance, but I think like @Jasarien said - They mean for you to move to more discrete directories like cache or temp.
In fact what would definitely pass the review is switching to Core Data and using the internal SQLite - but that's probably too much work.
So to wrap up - a post on how to save to caches or tmp - Where to save files in iOS 5 applications? (actually, maybe this was all a duplicate of that one... :-/)
GL! Oded
-- Edit --
Another good post: https://stackoverflow.com/questions/8164868/ios-data-storage-guidelines-available-since-when
-- Edit #2 --
And another good post: iOS 5 does not allow to store downloaded data in Documents directory?
Guess I should've just pointed out the duplicates... :)