gpt4 book ai didi

objective-c - 为什么在标准存档上使用 UIDocument

转载 作者:行者123 更新时间:2023-11-29 11:11:26 24 4
gpt4 key购买 nike

我使用过 UIDocument,但我不明白与使用 Archiving 相比有何优势?假设您不想使用 iCloud。

最佳答案

来自 Apple 的文档:http://developer.apple.com/library/ios/#documentation/uikit/reference/UIDocument_Class/UIDocument/UIDocument.html

Applications that make use of UIDocument and its underlying architecture get many benefits for their documents:

  • Asynchronous reading and writing of data on a background queue. Your application's responsiveness to users is thus unaffected while reading and writing operations are taking place.
  • Coordinated reading and writing of document files that is automatically integrated with cloud services. Support for discovering conflicts between different versions of a document (if that occurs).
  • Safe-saving of document data by writing data first to a temporary file and then replacing the current document file with it.
  • Automatic saving of document data at opportune moments; this mechanism includes support for dealing with suspend behaviors.

你也可以很好地与 NSUndoManager 集成

关于objective-c - 为什么在标准存档上使用 UIDocument,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11413926/

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