在 xcode 中从其他目录导入文件 [英] importing files from other directories in xcode
问题描述
我有以下目录结构.
A
|---B
| |---C
| |---D
|
|
|---E
| |---F
| |---G
我有一个目录,在该目录下有 B 和 E.在 B 中,我有 C 和 D 文件,在 E 中有 F 和 G 文件.
I have A directory under which I have B and E. In B, I have C and D files and in E I have F and G files.
我正在处理 G 文件,我需要导入 D 文件.我怎么做 ?如果我直接写 import "G.h" 它会抛出错误,因为它会在 E 文件夹中搜索.如果我使用 import ,它会抛出错误.请让我知道如何在 Xcode 中遍历目录.我正在使用最新版本的 XCode(Xcode 4.6).谢谢!
I am working on G file and I need to import D file. How do I do that ? If I directly write import "G.h" its throwing error as it will search in E folder. If I use import , its throwing error. Please let me know how to traverse directories in Xcode. I am using latest version of XCode (Xcode 4.6). Thanks!
推荐答案
如果您已将文件正确添加到项目中,您应该能够简单地编写
If you have added the files to the project correctly you should simply be able to write
#import "G.h"
因为物理位置应该不是问题.Xcode 应该跟踪这些.
as the physical location should not be an issue. Xcode should be keeping track of those.
尝试删除并重新添加有问题的文件.
Try removing and re-adding the files in question.
这篇关于在 xcode 中从其他目录导入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!