简体   繁体   English

具有两个项目的Xcode 4工作区无法访问彼此的文件

[英]Xcode 4 workspace with two projects can't access each other's files

I have two projects in a workspace. 我在工作区中有两个项目。 Project A needs to access some files in Project B (Kal). 项目A需要访问项目B(Kal)中的某些文件。 When I do an import (in Project A), I start the #import and a popup gives me choices of all the files I have available to me. 当我进行导入时(在项目A中),我启动#import,然后弹出窗口为我提供我可以使用的所有文件的选择。 I choose Kal.h, and immediately get the red flag saying it can't find the file. 我选择Kal.h,并立即得到红色标记,表明它找不到文件。

According to the Apple Docs on Workspaces , XCode should automatically find the file... is this not true? 根据工作区上的Apple Docs ,XCode应该会自动找到该文件...这不是真的吗? Do I still have to set the search paths, etc? 我仍然需要设置搜索路径等吗?

The passage you quote indicates something slightly different than what you want. 您引用的段落表示与您想要的内容略有不同。 In particular, the Workspace has access to both sets of files, but the peer projects do not have access to each other's files. 特别是,工作区可以访问两组文件,但是对等项目则不能访问彼此的文件。

If your Project A needs access to files in Project B, you can set up your workspace that Project A includes a reference to Project B. In this case, Project A will have access to Project B's files, although not vice-versa. 如果您的项目A需要访问项目B中的文件,则可以将工作区设置为项目A包含对项目B的引用。在这种情况下,项目A将可以访问项目B的文件,但反之则不然。 This will work for headers, or for object files. 这将适用于标题或目标文件。

To add one project to another project within a workspace, select the Project A in the workspace, and then choose File > Add Files to Project A... and select Project B's project file in the standard file window. 要将一个项目添加到工作区中的另一个项目,请在工作区中选择Project A,然后选择File > Add Files to Project A...然后在标准文件窗口中选择Project B的项目文件。 This will add it to Project A, giving Project A access to the Project B files. 这会将其添加到项目A,使项目A可以访问项目B文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在工作区xcode7中的两个项目之间导入文件 - Cannot import files between two projects in a workspace xcode7 将两个Xcode项目与通用文件合并 - Combine Two Xcode Projects with common files xcode无法将其他项目添加到工作区中 - xcode can't add additional project into workspace 当工作区中有多个xcode项目时,如何将cocoapods cordova插件src链接到.framework头文件? - How to link a cocoapods cordova plugin src to a .framework header file when there's multiple xcode projects in the workspace? 工作区中多个项目的Xcode 7代码覆盖率报告 - Xcode 7 Code Coverage reporting for multiple projects in a workspace 两个类相互引用/从其委托方法中的UITextField访问UITableViewCell吗? - Two classes reference each other / access UITableViewCell from UITextField inside it's delegate methods? 如何在Xcode中互相使用两个类的对象? - How to use object of two class in each other in xcode? 两个对象可以互相代表吗? - Can two objects be delegates of each other…? 无法访问Web内容,快速(Xcode) - Can't access web content, swift (Xcode) 确定在Xcode 5工作区中构建项目的顺序(具有静态库项目之间的依赖关系) - Determine order of building projects in Xcode 5 workspace (with dependencies between static library projects)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM