ios – Icloud副本获取错误域= NSCocoaErrorDomain代码= 512

当我将文件从本地应用程序复制到iCloud时,文件被复制但我收到此错误:
错误域= NS CocoaErrorDomain代码= 512“操作无法完成.(可可错误512.)”

这是代码

NSString *source = [tagsPath stringByAppendingPathComponent:current_Group_Name];
source = [source stringByAppendingPathComponent:fileName];

NSURL *sourceURL = [NSURL fileURLWithPath:source];

dispatch_queue_t q_default;
q_default = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);
dispatch_async(q_default,^(void) {

    fileManager = [NSFileManager defaultManager];

    NSURL *ubiq = [fileManager URLForUbiquityContainerIdentifier:nil];
    if (ubiq) {
        NSURL *groupURL = [tagsURL URLByAppendingPathComponent:current_Group_Name];
        NSError *error= nil;
        NSURL *destinationURL = [groupURL URLByAppendingPathComponent:fileName];

        [fileManager setUbiquitous:YES
                     itemAtURL:sourceURL
                     destinationURL:destinationURL
                     error:&error];
                if (error != nil)
                { NSLog( @"Error > %@",error);
                 [self displayError:NSLocalizedString(@"XMP file not saved in iCloud.",@"") withReason:[NSString stringWithFormat:@"%@%d",NSLocalizedString(@"Error code : ",@""),[error code]]];}

    dispatch_queue_t q_main = dispatch_get_main_queue();
    dispatch_async(q_main,^(void) {
    });
});

有什么建议 ?

谢谢

解决方法

这只发生在我的IOS6设备上,奇怪的是它实际上似乎是保存,当我加载我的保存数据时,唯一的问题是,如果我删除应用程序然后重新下载它,它似乎擦除了icloud数据

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...