具有多个目标的Xcode项目是否可以针对每个目标使用不同的Settings.bundle? [英] Can an Xcode project with multiple targets have different Settings.bundle's for each target?

查看:68
本文介绍了具有多个目标的Xcode项目是否可以针对每个目标使用不同的Settings.bundle?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPhone应用程序中有一个设置包,它有几个微妙的变体目标。

I have a settings bundle in an iPhone app which has several subtle variant targets.

问题是我需要在每个设置包中自定义一些字符串来制作它们适合每个目标。似乎如果Settings包被命名为除Settings.bundle以外的任何东西,它将不会拾取捆绑包(可以理解,我可以在plist中指定替代名称吗?)。

The problem is I need to customise some strings in each settings bundle to make them appropriate for each target. It appears that if the Settings bundle is named anything other than Settings.bundle it won't pick up the bundle (understandable, can I specify in a plist somewhere the alternate name?).

如果我尝试将它们放在不同的文件夹中并将它们称为相同的东西,Xcode会非常混乱,并允许您编辑实际上是同一个源的2个文件。

If I try and put them in different folders and call them the same thing Xcode gets horribly confused and lets you edit "2 files" that are actually the same single source.

推荐答案

我认为没问题。对于每个目标,使用此目标的文件创建特定文件夹。现在,在Xcode中为每个文件夹创建一个组,并将每个新的Settings.bundle目录拖到相应的组中。将包添加到项目时,请确保仅通过选中相应的框来为其目标构建(包含)每个包。

I see no problem. For every target, create a specific folder with files for this target. Now create a group in Xcode for every of those folders and drag each of the new Settings.bundle directories to the corresponding group. When adding the bundles to the project, make sure that every bundle is only built (included) for its target by checking the appropriate box.

这篇关于具有多个目标的Xcode项目是否可以针对每个目标使用不同的Settings.bundle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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