创建一个包 - 出了什么问题?

joe*_*nge 1 macos cocoa bundle info.plist

我在这里有一个相对简单的.我正在捆绑包住我的应用程序的Resources文件夹(可能在Application Support文件夹中).这些包将包含应用程序处理的数据的模板信息.我已经构建了一个包,扩展名为"booksprintstyle",目录结构符合规范.我有一个Info.plist全部设置,我想我已经填写了我需要的所有值.我是否需要在我的应用程序中更改某些内容以将这些文件夹扩展名识别为包文件,或者我在捆绑结构中缺少某些内容?我注意到一些bundle有一个名为PkgInfo的文件; 那很重要吗?

以下是我的捆绑包中的Info.plist.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleGetInfoString</key>
    <string>1.0, Copyright © 2009 Joey Lange</string>
    <key>CFBundleIdentifier</key>
    <string>net.atherial.books.exporter.printingpress.printstyle</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Books Print Style - Generic</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleDisplayName</key>
    <string>Books Print Style - Generic</string>
    <key>NSHumanReadableCopyright</key>
    <string>Copyright © 2009 Joey Lange</string>
    <key>CFBundleVersion</key>
    <string>1.0</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

Pet*_*sey 6

我是否需要在我的应用程序中更改某些内容以将这些文件夹 - 扩展名识别为包文件...

是.在应用程序的Info.plist中导出UTI声明,以获取这些包的类型.您将声明UTI符合com.apple.package.有关更多信息,请参阅了解统一类型标识符.

以下是我的捆绑包中的Info.plist.

那是不相关的.必要的声明在您的应用程序包中,而不是您的文档/插件包.

我注意到一些bundle有一个名为PkgInfo的文件; 那很重要吗?

没有.