UIDocument not saving to file despite indicating success

前端 未结 3 624
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-05 04:45

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 u

3条回答
  •  情话喂你
    2021-02-05 04:57

    In addition to the above answers, another cause of this can be that there's an error during the save process unrelated to contents(forType:).

    For example, if you implement fileAttributesToWrite(to:for:) and throw an error, then this can cause a UIDocumentState.savingError even though contents(forType:) returns the correct data.

提交回复
热议问题