简体   繁体   English

Xcode-基于文档的应用程序(文档包)

[英]Xcode - Document Based Application (Document Bundle)

I'm trying to find a somewhat more comprehensive writeup, or an example to refer to regarding a Document Based Application which saves it's contents to a document bundle rather than a single file. 我正在尝试找到更全面的文章,或参考一个有关基于文档的应用程序的示例,该文档将其内容保存到文档包而不是单个文件中。

A good example of what I mean by a document bundle is how Pages saves it's documents ie Pages如何保存文档的一个很好的例子就是我所说的文档捆绑,即

Document Name.myextension\
                          directory1\
                                     somefile.ext
                                     somefile2.ext
                          directory2\
                          directory3\
                          file1.png
                          file2.png

As we know apples documentation, although extensive, can, at the best of times be somewhat daunting to work with :-/ 众所周知,尽管苹果文档丰富,但在最好的情况下使用:-/可能有些令人生畏。

Any help would be appreciated! 任何帮助,将不胜感激!

Thanks 谢谢

Ade 阿德

Take a look at the following Stack Overflow question: 看一下以下堆栈溢出问题:

NSDocument to hold a complete folder? NSDocument保存一个完整的文件夹?

If the answer to that question isn't detailed enough, you can read the following article on file packages: 如果对该问题的答案不够详细,则可以阅读以下有关文件包的文章:

Working with Cocoa File Packages 使用可可文件包

Regarding Apple's documentation, the relevant classes to look at are NSFileWrapper, NSData, and NSDocument. 关于Apple的文档,要查看的相关类是NSFileWrapper,NSData和NSDocument。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM