xcode复制文件构建阶段 - 目的地选项是什么意思? [英] xcode copy files build phase - what do the destination options mean exactly?

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

问题描述



XCode docs 这不会解释每个目标路径映射到光盘上相对于我的应用程序包。



如果我使用这个应用程序作为例子,有人可以给一个规范的答案,每个将相对于这个目录结构文件?



解决方案

您的示例中的应用包是 Viewer 。这不是一个文件;它是一个目录。



产品目录是查看器

的目录, / code>。



对于iOS,Wrapper是 Viewer 中的顶级目录。 / p>

对于iOS,Executable是与Wrapper相同的目录。



对于iOS,资源进入Wrapper目录,或本地化目录( Base.lproj 等)。



其他目录对于iOS是有意义的。



仍然,你应该使用逻辑上的目录。使用可执行文件表示我的可执行文件所在的目录。不要假定目录树在内部是以特定的方式布局的。



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


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?

解决方案

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.

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

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

For iOS, Executable is the same directory as Wrapper.

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

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.

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天全站免登陆