我在閱讀關於此問題的許多問題。我爲我的應用使用了Phonegap。 我的應用程序下載約3mb的圖像。 Apple拒絕我的應用程序,並建議將「不備份屬性」應用於所有文件。 How do I prevent files from being backed up to iCloud and iTunes?2.23應用程序必須遵循iOS數據存儲指南,否則它們將被拒絕
我使用此代碼爲我的5.1應用程序:
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);
NSError *error = nil;
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
forKey: NSURLIsExcludedFromBackupKey error: &error];
if(!success){
NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
}
return success;
}
我把它放在我的AppDelegate.m。這是對的嗎?
我想補充說,所有的文件都在「/ var/mobile/Applications/CEEECEA6-4684-4599-B0BF-407BE2CBD3CE/Library/Caches /」 – Corallino