gpt4 book ai didi

xcode - bundle 名称和 bundle 显示名称

转载 作者:行者123 更新时间:2023-12-04 01:55:02 27 4
gpt4 key购买 nike

已经提出了有关捆绑名称和捆绑显示名称的类似问题,例如:

What's the difference between "bundle display name" and "bundle name" in cocoa application's info plist

但到目前为止,我还没有读到关于何时需要同时使用它们、何时可以不同地指定它们等的非常简洁的答案。

该文档似乎表明 bundle display name 仅在您进行本地化时才有用,如果您在没有本地化时指定它,则可能会损害性能。

有人可以一劳永逸地解决这些问题吗?

苹果的文档

CFBundleName (String - iOS, Mac OS X) identifies the short name of the bundle. This name should be less than 16 characters long and be suitable for displaying in the menu bar and the application’s Info window. You can include this key in the InfoPlist.strings file of an appropriate .lproj subdirectory to provide localized values for it. If you localize this key, you should also include the key “CFBundleDisplayName.”

CFBundleDisplayName (String - iOS, Mac OS X) specifies the display name of the bundle. If you support localized names for your bundle, include this key in both your information property list file and in the InfoPlist.strings files of your language subdirectories. If you localize this key, you should also include a localized version of the CFBundleName key.

If you do not intend to localize your bundle, do not include this key in your Info.plist file. Inclusion of this key does not affect the display of the bundle name but does incur a performance penalty to search for localized versions of this key.

Before displaying a localized name for your bundle, the Finder compares the value of this key against the actual name of your bundle in the file system. If the two names match, the Finder proceeds to display the localized name from the appropriate InfoPlist.strings file of your bundle. If the names do not match, the Finder displays the file-system name.

最佳答案

CFBundleDisplayName 用于更改设备(和模拟器)上应用程序图标下方的文本。是的,这应该是本地化的,但是编辑它或让它说出你想要的任何内容并没有明显的性能损失。

要编辑它,您可以更改项目中“信息”下的“捆绑显示名称”:

Location of the Bundle display name attribute

CFBundleName 不是一个线索。我无法弄清楚这是什么变化或为什么。

关于xcode - bundle 名称和 bundle 显示名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9667582/

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