2012-01-21 106 views
1

在我的應用程序開始時,我想永久刪除iCloud中的一些項目。從iCloud中刪除項目 - 「無法禁用未同步項目上的同步」。

但無論如何,控制檯告訴我「無法禁用未同步項目上的同步」。

dispatch_async(globalQueue, ^(void) { 
    NSFileManager *fileManager = [[NSFileManager alloc] init]; 
    NSError *error = nil; 
    // Move the file. 
    BOOL success = [fileManager setUbiquitous:NO itemAtURL:removeItemURL 
           destinationURL:dest error:&error]; 

    dispatch_async(dispatch_get_main_queue(), ^(void) { 
     if (! success) { 
      NSLog(@"MEGA ERROR %@", [error userInfo]); 
     } 
    }); 
}); 

回答

0

看來你想從無處不在的文件不存在。這就是錯誤信息所說的。你有沒有檢查(通過NSMetadataQuery)文件是否在iCloud中?

+0

我第一次沒有看到我的文件的URL不正確,但是你是對的,該方法找不到該文件,因爲我忘記了參數「itemAtURL:」中的「Documents」文件夾:「 非常感謝 –