是否可以在 iPhone 上添加新的应用程序变量,类似于 ${EXECUTABLE_NAME}?
我想在 info.plist 中引用我自己的变量构建设置文件。
这可能吗?有什么想法吗?
I'd like to reference my own variables in my info.plist & build settings files.
Is this possible? Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您通过右下角的“添加构建设置”按钮添加自定义构建设置,那么您应该能够在 info.plist 中使用 ${} 表单来引用这些变量的名称。
例如,我有一个名为“PJ_VERSION_EXTRA”的设置。在我的 Info.plist 中,我有:
在我的调试构建配置中,我将该设置定义为“-DEBUG”。这意味着当我在应用程序中显示版本字符串时,调试版本会识别自己。
If you add custom build settings via the 'add build setting' button in the bottom right, then you should be able to use the ${} form within your info.plist to reference the names of those variables.
For example, I have such a setting called 'PJ_VERSION_EXTRA'. In my Info.plist I have:
In my debug build configuration, I define that setting as '-DEBUG'. That means that when I show the version string in app, debug builds identify themselves.
我可以看到这样做有什么问题。
应该像向 info plist 添加条目一样简单,然后使用检索它
I can see any problems with doing this.
Should be as simple as adding an entry to the info plist, and then retrieving it using