xcode 将资源目录层次结构包含到应用程序包中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1401338/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:49:34  来源:igfitidea点击:

Include a resource directory hierarchy into app bundle

iphonexcode

提问by Jaka Jan?ar

I have a directory structure (multiple levels deep) of resources, that I would like to include into the app bundle. Is this possible without creating a Copy Files phase for each directory in the hierarchy individually?

我有一个资源的目录结构(多级深度),我想将其包含到应用程序包中。如果不为层次结构中的每个目录单独创建复制文件阶段,这是否可能?

回答by zaph

Drag the source folder to the project "Groups & Files" area, say under the Resources group. In the dialog select "Create Folder References for any added folders". This will create a blue folder and the folder will and it's inter hierarchy will appear in the apps resources. This will automatically create an entry in "Copy Bundle Resources" build phase This is commonly done for help files.

将源文件夹拖到项目“组和文件”区域,比如在资源组下。在对话框中选择“为任何添加的文件夹创建文件夹引用”。这将创建一个蓝色文件夹,该文件夹及其内部层次结构将出现在应用程序资源中。这将在“复制捆绑资源”构建阶段自动创建一个条目 这通常用于帮助文件。

回答by fbrereto

As far as I know you can specify the top-level directory in the Copy Files phase, which should bring the entire directory's contents to the destination you specify.

据我所知,您可以在 Copy Files 阶段指定顶级目录,这应该将整个目录的内容带到您指定的目的地。