在 iOS XCode 项目中更改产品名称宏 [英] Change product name macro in iOS XCode project

查看:29
本文介绍了在 iOS XCode 项目中更改产品名称宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Apple 的示例项目之上构建了我的 iPhone 代码.当放置在 iPhone 的主屏幕上时,它将应用程序命名为LazyTable".我想更改此名称.如果我转到 info.plist 并在 Bundle display name 键中手动输入一个新名称,它会起作用.但我不想硬编码,因为 PRODUCT_NAME 用在很多地方.

I built my iPhone code atop Apple's sample project. It names the app "LazyTable" when placed on the home screen on iPhone. I would like to change this name. If I go to info.plist and manually type in a new name into the Bundle display name key, it works. But I don't want to hardcode because the PRODUCT_NAME is used in many places.

Info.plist

所以我进入项目">编辑项目设置"来更改宏.我关上窗户,清洁并重建.应用名称仍然卡在LazyTable"上!如何使对宏的此更改生效?

So I go into Project > Edit Project Settings to change the macro. I close the window, clean, and rebuild. The app name is still stuck with "LazyTable"! How do I make this change to the macro take effect?

项目信息

推荐答案

您使用的方法是正确的.但是,请记住,每个目标都可以有自己的设置来覆盖项目设置.确保目标不会覆盖 PRODUCT_NAME.

The approach you are using is correct. However, remember that each target can have their own settings that will override the project settings. Make sure the target does not override PRODUCT_NAME.

为此,请在 Xcode 项目浏览器中选择项目,然后选择目标.每个目标都有自己的构建设置.就像在编辑项目构建设置时一样更改 PRODUCT_NAME.

To do this, select the project in the Xcode project browser, then select the target. Each target has it's own build settings. Change the PRODUCT_NAME just as you would when editing the project build settings.

这篇关于在 iOS XCode 项目中更改产品名称宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆