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