cocoa - 创建 bundle - 出了什么问题?

标签 cocoa macos bundle info.plist

我这里有一个相对简单的。我正在将 bundle 放置在应用程序的 Resources 文件夹中(也可能位于应用程序支持文件夹中)。这些包将包含应用程序处理的数据的模板信息。我已经构建了一个 bundle ,扩展名为“booksprintstyle”,并且目录结构符合规范。我已经设置好了 Info.plist,并且我想我已经填写了我需要的所有值。我是否需要更改应用程序中的某些内容才能将这些带有扩展名的文件夹识别为 bundle 文件,或者我是否在 bundle 结构中丢失了某些内容?我注意到有些 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>

最佳答案

Do I need to change something in my App to have these folders-with-extensions recognized as bundle files…

是的。在应用程序的 Info.plist 中导出这些 bundle 类型的 UTI 声明。您将声明 UTI 符合 com.apple.package。请参阅Understanding Uniform Type Identifiers了解更多。

Below is the Info.plist from my bundle.

这不相关。必要的声明位于您的应用程序包中,而不是您的文档/插件包中。

I noticed that some bundles have a file called PkgInfo; is that important?

No.

关于cocoa - 创建 bundle - 出了什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/926766/

相关文章:

iPhone应用程序 : How do they do that?

macos - Mac CoreLocation 服务不请求权限

ruby-on-rails - 加载错误 "libmysqlclient.18"- gem mysql2

macos - 资源未 bundle 到应用程序中

cocoa - 将 (u)int64_t 转换为 NSNumber

objective-c - 我可以在 xcode 中做些什么来解决这不是 utf-8 静态库问题吗?

c++ - macOS上的wxWidgets暗模式

python - 如何从Windows上开发的Python脚本在Mac上创建可执行文件

javascript - 这些js和css文件如何从我的元素中排除?

iphone - NSDate 保留发送到释放实例的消息