Xcode复制文件构建阶段-“目标"是什么?选项是什么意思? [英] Xcode Copy Files Build Phase - what do the "Destination" options mean?

查看:75
本文介绍了Xcode复制文件构建阶段-“目标"是什么?选项是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为此 Xcode文档相对于我的应用程序包,没有确切说明每个目标"路径在磁盘上的映射位置.

The Xcode docs for this don't explain exactly where each of the Destination paths maps to on disc, relative to my application package.

如果以我的应用程序为例,有人可以给出一个规范的答案,每个人都将相对于此目录结构放置文件吗?

If I use this app as an example, could someone give a canonical answer where each will put files relative to this directory structure?

推荐答案

您的示例中的应用程序捆绑包是 Viewer .这不是文件;这是一个目录.如果单击它并显示包装内容",则将看到其余内容.

The app bundle in your example is Viewer. This is not a file; it's a directory. If you click on it and "Show Package Contents", you'll see the rest of it.

产品目录是 Viewer 写入的目录.您无法在iOS中写入此目录.

Products Directory is the directory that Viewer is written to. You cannot write to this directory in iOS.

对于iOS,包装程序是 Viewer 中的顶级目录.

For iOS, Wrapper is the top level directory within Viewer.

对于iOS,Executable与Wrapper位于同一目录.

For iOS, Executable is the same directory as Wrapper.

对于iOS,如果资源已本地化,资源将进入包装器目录或本地化目录( Base.lproj 等).

For iOS, Resources go into either the Wrapper directory, or the localization directories (Base.lproj, etc) if the resource is localized.

其他目录对iOS没有意义.

The other directories aren't meaningful for iOS.

仍然,您应该在逻辑上使用目录.使用可执行文件"表示可执行文件所在的目录".不要以为目录树是内部布置的特定方式.

Still, you should use the directories logically. Use "Executable" to mean "the directory where my executable lives." Don't assume that the directory tree is laid out a particular way internally.

关于您需要知道访问文件的路径的评论,您不需要(并且不应尝试).您应该使用 [NSBundle pathForResource:ofType:] 查找文件.

Regarding you comment that you need to know the path to access the file, you do not need that (and shouldn't try). You should use [NSBundle pathForResource:ofType:] to find files.

这篇关于Xcode复制文件构建阶段-“目标"是什么?选项是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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