[英]How do I add files to the Copy Bundle Resources build phase with an Xcode4 Project Template
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 4项目模板,我正在努力控制添加到Copy Bundle Resources构建阶段的文件 - 添加了头文件,我不想将其复制到项目包和文件中我想要复制的内容不会出现在此列表中(包含静态库和图像资源的自定义.framework文件)。
It seems like Xcode automatically builds contents of this build phase from the Nodes section in the project template; 看起来Xcode会自动从项目模板的Nodes部分构建此构建阶段的内容; 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.
如果它是.framework,它会自动添加到链接库中,如果它是.m,它会自动添加到已编译的源中,其他所有内容都会添加到Copy Bundle Resources中。
I'd be grateful for any direction on this one! 我很感激这个方向的任何方向!
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. 更新:为了澄清,我正在尝试创建一个Xcode项目模板,该模板在使用时会创建一个新的Xcode项目,该项目包含Copy Bundle Resources构建阶段中模板中的指定文件。
Yes, Xcode tries to manage this for you. 是的,Xcode试图为您管理这个。 If after adding a file, it did not did what you want, then change it.
如果在添加文件后,它没有按照您的要求进行操作,则更改它。 It's guesses are "usually" correct "most" of the time.
猜测通常是“通常”正确“最”的时间。 :)
:)
This should help. 这应该有所帮助。 After the Class-Resources key-value pair, you can add files somehow.
在Class-Resources键值对之后,您可以以某种方式添加文件。 I couldn't figure that out but I'm sure you can find it somewhere.
我无法理解,但我相信你可以在某个地方找到它。
EDIT: Actually, i think an easier way is to in the Definition part, after the Path key, add a TargetIndices key (an array). 编辑:实际上,我认为更简单的方法是在定义部分,在Path键之后,添加一个TargetIndices键(一个数组)。 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.
通过一些实验,您应该能够找到放在该数组的一个项目上的值,以将其放入Copy Bundle Resources构建阶段。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.