如何使用Xcode4项目模板将文件添加到“副本捆绑资源"构建阶段 [英] How do I add files to the Copy Bundle Resources build phase with an Xcode4 Project Template

查看:120
本文介绍了如何使用Xcode4项目模板将文件添加到“副本捆绑资源"构建阶段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理Xcode 4项目模板,我正在努力控制要添加到复制捆绑资源"构建阶段的文件-添加了不想复制到项目捆绑中的头文件并且我确实要复制的文件没有出现在此列表中(一个既包含静态库又包含图像资源的自定义.framework文件).

I'm working on an Xcode 4 project template and I'm struggling with controlling the files that get added to the Copy Bundle Resources build phase--header files get added that I do not want to be copied into the project bundle and a file that I do want to be copied does not appear in this list (a custom .framework file that contains both the static library and image resources).

似乎Xcode从项目模板的节点"部分自动构建了该构建阶段的内容;如果是.framework,它将自动添加到链接库中;如果是.m,则它将自动添加到编译源中,其他所有内容都将添加到副本捆绑资源中.

It seems like Xcode automatically builds contents of this build phase from the Nodes section in the project template; if it's a .framework, it automatically gets added to the linked libraries, if it's a .m, it automatically gets added to compiled sources, and everything else gets added to the Copy Bundle Resources.

我将很高兴为此提供任何指导!

I'd be grateful for any direction on this one!

更新: 为了明确起见,我正在尝试创建一个Xcode项目模板,该模板在使用时会创建一个新的Xcode项目,该项目包括在复制捆绑资源"构建阶段中的模板中指定的文件.

Update: To clarify, I'm attempting to create an Xcode project template that, when used, creates a new Xcode project that includes the specified files from the template in the Copy Bundle Resources build phase.

推荐答案

这应该有所帮助.在类资源"键值对之后,您可以以某种方式添加文件.我无法弄清楚,但我确定您可以在某个地方找到它.

This should help. After the Class-Resources key-value pair, you can add files somehow. I couldn't figure that out but I'm sure you can find it somewhere.

实际上,我认为一种更简单的方法是在定义"部分中,在路径"键之后添加一个TargetIndices键(一个数组).经过一些试验,您应该能够找出要在该阵列的一项上放置什么值,以便将其放入复制捆绑资源"构建阶段.

Actually, i think an easier way is to in the Definition part, after the Path key, add a TargetIndices key (an array). With some experimenting you should be able to find out what value to put on one item of that array to put it in the Copy Bundle Resources build phase.

这篇关于如何使用Xcode4项目模板将文件添加到“副本捆绑资源"构建阶段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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