Xcode针对不同目标的不同资源 [英] Xcode Different Resources For Different Targets

查看:120
本文介绍了Xcode针对不同目标的不同资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发iPhone应用程序,该应用程序将具有完整版和精简版.为了从相同的源代码和Xcode项目中获得两个捆绑包,我在Xcode项目中添加了另一个目标.

I am developing an iPhone app and there will be a Full as well as a Lite version of that app. In order get both bundles from the same source code and Xcode project I added another target to the Xcode project.

现在,我想让Lite目标仅将资源文件的一个子集复制到分发包中.但是,由于我将所有资源导入为文件夹引用,因此Xcode不会简单地让我从将文件复制到捆绑包"构建步骤中删除单个文件.我需要这样做,以便在资源目录中维护目录结构.

Now, I want to have the Lite target copy only a subset of the resource files to the bundle. But, Xcode won't simply let me delete individual files from the "Copy Files to Bundle" build step, since I imported all my resources as folder references. I need this in order to maintain a directory structure in the resources directory.

如何解决此问题?任何建议或想法都将不胜感激!

How do I solve this problem? Any suggestions or ideas are greatly appreciated!

推荐答案

在Xcode的左侧面板中,右键单击顶部的组和文件"栏.选中目标成员身份".

In the left-hand panel of Xcode, right-click on the "Groups & Files" bar at the top. Check "Target Membership".

现在,您将在当前构建目标中应包含的每个文件上打勾.取消选中不需要的对象,切换到其他目标,然后重复.

Now you'll see a tick against every file that should be included in your current build target. Untick the ones you don't want, switch to your other target, and repeat.

这篇关于Xcode针对不同目标的不同资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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