尽管表示成功,但UIDocument未保存到文件 [英] UIDocument not saving to file despite indicating success
问题描述
我正在尝试使用 UIDocument
在iCloud Drive中打开,修改和保存文件。当我使用文件位置调用 save(to:for:completionHandler:)
并使用 .forOverwriting
为 UIDocumentSaveOperation
,它的状态为 success = true
。但是,iCloud文件(如桌面和iOS文件浏览器中所示)不会更新,并且在重新打开文件时,不会显示更改。我已经验证了内容(forType :)
在保存时会返回正确的(修改过的)文件内容。
I'm trying to open, modify, and save a file in iCloud Drive using UIDocument
. When I call save(to:for:completionHandler:)
with the file location and using .forOverwriting
for the UIDocumentSaveOperation
, it completes with a status of success = true
. However, the iCloud file (as seen in both desktop and iOS file browser) does not update, and when reopening the file, the changes are not shown. I've verified that contents(forType:)
returns the correct (modified) file contents when saving.
这篇关于尽管表示成功,但UIDocument未保存到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!