当我将文件从本地应用程序复制到 iCloud 时,文件被复制但我收到此错误:错误域 = NSCocoaErrorDomain 代码 = 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) {
});
});
有什么建议么 ?
谢谢