【发布时间】:2012-12-02 07:23:17
【问题描述】:
我正在阅读很多关于这个问题的问题。我正在为我的应用程序使用 Phonegap。 我的应用程序下载了大约 3mb 的图像。 Apple 拒绝我的应用并建议对所有文件应用“不备份属性”。How do I prevent files from being backed up to iCloud and iTunes?
我将此代码用于我的 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/”中
标签: ios objective-c cordova appstore-approval