我发现显然有可能 上传没有狮子号安装的应用程序 ,但我的应用程序下载了一些大型文件,需要根据
包括以下代码,由于使用未申报标识符NSURLIs的 < code > 使用未申报标识符NSURLIs Exclate from BackupKey ,我甚至无法编译:
-(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL{
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"5.1")) {
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;
}
}
当我在xcode里只有iOS 5.0SDK的时候 我怎么能一直使用这个代码呢?
(或我的欲望没有意义,因为我实在不能告诉我的应用程序它支持 iOS 5.1? )
- (
SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO
comes from https://stackoverflow.com/a/5337804/194309)