如何让 Xcode 将 Info.plist 视为 iPhone/iPad Info.plist?

发布于 2024-09-24 01:59:53 字数 848 浏览 3 评论 0原文

我在一个 Xcode 项目中有两个 cocoa-touch 应用程序。 Xcode 为我提供了与 iPhone/iPad 相关的选项,用于第一个 Info.plist 中的键,例如“启动图像 (iPad)”。但是,Xcode 为我提供了第二个键的 Mac OS X 选项,例如“Java 类路径”和“快速查看预览高度”。

该项目的构建方式如下:

我使用 Xcode 将新项目创建为基于通用窗口的应用程序,该项目附带一个默认的 Info.plist,可将 UIPrerenderedIcon 等原始 plist 键转换为更易于人类阅读的值,例如“图标已经包含光泽效果。”一切都好。

在同一个 Xcode 项目中,我添加了第二个目标,也是一个 Cocoa-Touch 应用程序,并从头开始构建它,包括 Info.plist 文件。

我已经打开了两个应用程序的“活动目标”项目设置,并且只有一个“在此级别定义的设置”:产品名称。在较高的“项目设置”级别,未定义产品名称,并且 Info.plist 文件定义为 ${EXECUTABLE_NAME}/${EXECUTABLE_NAME}- Info.plist。 (其他设置,如前缀标头,类似地通过变量替换进行定义。)

两个应用程序都适当地构建、运行和使用各自的 Info.plist 文件,但 Xcode 仍然尝试向我提供 Mac OS X 信息。编辑第二个应用程序的 Info.plist 时的 plist 值。

我如何告诉 Xcode plist 应该是 iPad/iPhone Info.plist,而不是 Mac OS X Info.plist?

I have two cocoa-touch apps in one Xcode project. Xcode gives me iPhone/iPad related options for keys in the first's Info.plist, such as "Launch Image (iPad)". But, Xcode gives me Mac OS X options for keys for the second, such as "Java classpaths" and "Quick Look preview height."

Here's how the project was built:

I created the new project as a Universal Window-based Application using Xcode, which came with a default Info.plist that translates raw plist keys like UIPrerenderedIcon to more human readable values like "Icon already includes gloss effects." All good.

In the same Xcode Project, I added a second target, also a Cocoa-Touch application, and built it from scratch, including the Info.plist file.

I've opened up the "Active Target" project settings for both apps and have exactly one "Setting Defined at This Level": Product Name. At the higher "Project Settings" level, no Product Name is defined and the Info.plist File is defined as ${EXECUTABLE_NAME}/${EXECUTABLE_NAME}-Info.plist. (Other settings, like Prefix Header, are similarly defined with variable substitution.)

Both apps build, run and use their respective Info.plist files appropriately, but Xcode still tries to give me Mac OS X Info.plist values when editing the second app's Info.plist.

How can I tell Xcode that the plist should be an iPad/iPhone Info.plist, not a Mac OS X Info.plist?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

樱花细雨 2024-10-01 01:59:53

试试这个:选择/打开有问题的 Info.plist,然后从菜单中执行

View >属性列表类型> iPhone 信息.plist

Try this: select/open the Info.plist in question, and then from the menu, do

View > Property List Type > iPhone Info.plist

小镇女孩 2024-10-01 01:59:53

对于 Xcode 5,没有 View -> 属性列表类型,因此解决方案是打开文件,右键单击其中的任意位置,然后在显示原始键/值下找到属性列表类型菜单。

快乐编码,
Z。

for Xcode 5 there's no View -> Property List Type so the solution is to open the file, right click anywhere in it and right under Show Raw Keys/Values you'll find the Property List Type menu.

Happy coding,
Z.

池予 2024-10-01 01:59:53

我对此也很好奇。我在为 iPad 升级 iPhone 项目时遇到了同样的事情,经过几天的尝试弄清楚,我刚刚创建了一个新项目并重新导入了自定义类。我升级了目标,这次密钥仍然适用于 iOS。

我最好的猜测是这是一个 XCode 错误。

I'm also curious about this. I ran into the same thing while upgrading an iPhone project for iPad, and after days of trying to figure it out, I just made a new project and reimported the custom classes. I upgraded the target and this time the keys were still for iOS.

My best guess is this is an XCode bug.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文