简体   繁体   English

我可以在另一个Info.plist键值的内部使用Info.plist中一个键的值吗?

[英]Can I use the value for one key in Info.plist inside the value of another Info.plist key?

I'd like to use the value for 'Bundle display name' (CFBundleDisplayName) inside the value of another Info.plist key (NSContactsUsageDescription). 我想在另一个Info.plist键(NSContactsUsageDescription)的值内使用“捆绑显示名称”(CFBundleDisplayName)的值。

I tried the following, but this does not work: 我尝试了以下操作,但这不起作用:

${CFBundleDisplayName} must access your Address Book to input the scanned contact
information. ${CFBundleDisplayName} will never access your Address Book for marketing
or advertising purposes.

Does anybody know how to do that? 有人知道该怎么做吗?

Addendum: The solution should also work when localizing the value. 附录:解决方案在本地化值时也应起作用。

Using the ${VARIABLE} you can only reference build settings, but not other values in your Info.plist. 使用${VARIABLE}您只能引用构建设置,而不能引用Info.plist中的其他值。 Try adding a new user-defined build setting and use that. 尝试添加新的用户定义的构建设置并使用它。 Go to the Build Settings tab and click Add Build Setting in the bottom right corner. 转到“ 构建设置”选项卡,然后单击右下角的“ 添加构建设置 ”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM