1

I am using Xcode 7.3.1 to create a Cocoa document based application. I notice that in the Document Types info panel there is an option that I don't understand. It says "Document is distributed as a bundle" and it looks like this.

Bundle Option Screenshot from Xcode

I found that this option controls the LSTypeIsPackage key for CFBundleDocumentTypes in the app's Info.plist file. I was able to find only two explanations of the usage of this key in Apple's official documentation. Both were very brief entries in relatively large tables.

The first explanation from the App Creation Process Overview. It is very brief and offers no more information than the screenshot above.

A Boolean value specifying whether the document is distributed as a bundle. If NO, omit this value.

The second explanation is a little more helpful. It comes from the Mac Developer Library's Information Property List Core Foundation Keys Reference.

Specifies whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. (In OS X v10.4 and later, this key is ignored if the LSItemContentTypes key is present.)

It almost sounds as if this option affects how the application bundle itself is treated by the OS. If that's the case then I really have no idea what to make of these descriptions.

I know that many document types (such as .xcodeproj documents) are actually directories. Does this setting control whether documents are directories?

4

1 回答 1

3

如您所见,bundle 是一种专门的目录结构,其中包含特定文件(如Info.plist)。

文档包就是这样一种捆绑包。

所以

此设置是否控制文档是否为目录?

是的; 但是您不会将其称为目录;这是一个捆绑包。

于 2016-07-20T07:11:16.873 回答