在 XCode 4.x 中添加项目作为依赖项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5373192/
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 20:35:19  来源:igfitidea点击:

Adding project as dependency in XCode 4.x

xcodedependencies

提问by intepid

With the revamp of XCode I am having a lot of trouble working out how to add make one xcodeproj dependent on another. It was hard enough to work out before but now I am just stuck.

随着 XCode 的改造,我在解决如何添加使一个 xcodeproj 依赖于另一个时遇到了很多麻烦。以前很难锻炼,但现在我只是被困住了。

If I drag lib.xcodeproj into app.xcodeproj it just shows up as an item in the project tree and I can't expand it or see build products for linking.

如果我将 lib.xcodeproj 拖到 app.xcodeproj 中,它只会显示为项目树中的一个项目,我无法展开它或查看用于链接的构建产品。

Can someone give me the correct sequence for adding lib.xcodeproj as a dependency to app.xcodeproj (ie it will build if necessary and link to app)

有人能给我添加 lib.xcodeproj 作为对 app.xcodeproj 的依赖的正确顺序吗(即它会在必要时构建并链接到应用程序)

回答by intepid

Ahhh just worked out that the reason the lib project was being added as a useless non-expanding item was because I had the lib project open in another window. XCode gave me no indication that this was what the problem was, so I was lucky to stumble across it.

Ahhh 刚刚发现将 lib 项目添加为无用的非扩展项目的原因是因为我在另一个窗口中打开了 lib 项目。XCode 没有告诉我这就是问题所在,所以我很幸运地偶然发现了它。

Once I had closed the other window I was able to add the lib project and it showed up correctly as an expandable subtree, as well as now being visible for selection in the app target dependencies.

一旦我关闭了另一个窗口,我就可以添加 lib 项目,它正确地显示为一个可扩展的子树,并且现在可以在应用程序目标依赖项中进行选择。

回答by Caleb

The Xcode docs don't seem to be available online just now, so you'll have to search the documentation that came with Xcode for the following references. However, you'll find the information you're looking for under the following headings in Xcode Project Management Guide:

Xcode 文档目前似乎无法在线获得,因此您必须搜索 Xcode 随附的文档以获取以下参考资料。但是,您可以在Xcode 项目管理指南的以下标题下找到您正在寻找的信息:

  • Managing Targets (Adding a Target Dependency)
  • Referencing Other Projects
  • 管理目标(添加目标依赖)
  • 参考其他项目

回答by Callin Rim

check out BuildKit project https://github.com/davidmorford/BuildKit. It damatically reduce project dependency management effort.

查看 BuildKit 项目https://github.com/davidmorford/BuildKit。它大大减少了项目依赖性管理工作。

回答by hiennt

Dont forget to add the path to Classes of the lib project to tell your project where to find Header find

不要忘记添加lib项目的Classes的路径,告诉你的项目在哪里可以找到Header find

  • Go to build settings, find "Header Search Path", enter full path to the Classes folder
  • 进入构建设置,找到“Header Search Path”,输入Classes文件夹的完整路径