gpt4 book ai didi

objective-c - 设置无处不在 :itemAtURL:destinationURL:error: does not remove the item from iCloud

转载 作者:行者123 更新时间:2023-12-03 16:51:20 25 4
gpt4 key购买 nike

如果我发送消息

[[NSFileManager defaultManager] setUbiquitous:NO
itemAtURL:url
destinationURL:iCloudURL
error:&err]

从 iCloud 中删除项目,实际上并不会删除 Ubiquitous Container 上的文件。这是预期的行为吗?

该方法返回NO并且错误对象包含

Error Domain=NSCocoaErrorDomain Code=512 "The operation couldn’t be completed. (Cocoa error 512.)"

UserInfo=0x20870970 {NSURL=file://localhost/var/mobile/Applications/168EE8CD-4CDF-49BE-AD88-1DC7DD9CF25F/Documents/test.txt,

NSUnderlyingError=0x20863a00 "The operation couldn’t be completed. (LibrarianErrorDomain error 2 - Cannot disable syncing on a unsynced item.)"}

最佳答案

这个错误非常明显。您正尝试从 iCloud 中删除不在 iCloud 中的项目。当您想要使用 setUbiquitous:... 从 iCloud 删除项目时,项目 URL (itemAtURL:) 应为 iCloud URL。目标 URL 可以是本地内容(但如果 ubiquitous 设置为 NO 则被忽略)。

关于objective-c - 设置无处不在 :itemAtURL:destinationURL:error: does not remove the item from iCloud,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13306323/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com