Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 标记目录以避免iCloud备份_Ios_Icloud - Fatal编程技术网

Ios 标记目录以避免iCloud备份

Ios 标记目录以避免iCloud备份,ios,icloud,Ios,Icloud,我的应用程序的最新更新最近被拒绝,因为单个目录太大,无法备份(36MB)。这个目录,(/Documents/Templates/),不需要备份到iCloud,所以我想知道在备份发生时如何标记要避免的目录 这就是我目前被拒绝的原因: AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [sel

我的应用程序的最新更新最近被拒绝,因为单个目录太大,无法备份(36MB)。这个目录,
(/Documents/Templates/)
,不需要备份到iCloud,所以我想知道在备份发生时如何标记要避免的目录

这就是我目前被拒绝的原因:

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [self addSkipBackupAttributeToItemAtURL:finalURL];
    
    return YES;
}

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL

{
    
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
    NSString *directory = [paths objectAtIndex:0];
    directory = [directory stringByAppendingPathComponent:@"Templates"];
    
    NSFileManager *fileManager = [NSFileManager defaultManager];
    
    if ([fileManager fileExistsAtPath:directory] == NO) {
        
        NSError *error;
        if ([fileManager createDirectoryAtPath:directory withIntermediateDirectories:YES attributes:nil error:&error] == NO) {
            NSLog(@"Error: Unable to create directory: %@", error);
        }
        
        NSURL *url = [NSURL fileURLWithPath:directory];
        // exclude downloads from iCloud backup
        if ([url setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error] == NO) {
            NSLog(@"Error: Unable to exclude directory from backup: %@", error);
        }
    }
}

有什么问题吗?我觉得你现在的密码还可以。您是否收到任何错误或警告?请解释一下,我不确定。我大约一周前提交的,他们拒绝了,告诉我需要标记目录。所以我用上面的代码标记了目录,他们又拒绝了。同样的原因?你们在设备上检查过了吗?不,很遗憾。由于相同的原因或任何新的原因被拒绝了?