Xcode——当我有多个目标时让事情井井有条
这个非常有用的答案解释了如何在 Xcode 的不同目标中包含不同的文件项目。
我的问题更多的是一个哲学问题——我可以使用哪些约定来使事情井井有条?
我可能会遇到以下情况:
- 不同目标的类的不同版本
- 需要不同版本的类的不同头文件
- 我的项目的整个部分适用于某些目标,但不适用于其他目标
我想管理整个事情以最少的麻烦。
This very helpful answer explains how to include different files in different targets in an Xcode project.
My question is more of a philosophical one -- what conventions can I used to keep things organized?
Situations I am likely to encounter include the following:
- Different versions of a class for different targets
- Desire for different header files for said different versions of a class
- Whole portions of my project that apply to some targets but not others
I want to manage the whole thing with a minimum of fuss.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来多个项目是可行的方法,特别是当您有大量仅与一两个目标相关的文件时。这也意味着每个项目只能拥有一个类的一个版本,仅构建使用该版本的目标。当依赖目标位于不同项目中时,Xcode 仍然可以理解它们,只需将具有依赖项的项目导入到主项目中即可。
It sounds like multiple projects is the way to go, particularly where you have lots of files that are only relevant to one or two targets. It also means that you can have just one version of a class per project, only building targets that use this version. Xcode can still understand dependent targets when they're in different projects, just import the project with the dependency into the main project.
我发布了一个教程来解释当您有多个目标时如何保持事物井井有条。
关注它。
http://www.madnikblog.com/blog/2013/09/19/organize-xcode-project-with-multiple-targets/
简单的想法是。
所有逻辑都位于静态库中,该静态库实际上是每个可执行目标的依赖目标。
所有资源都保留在一个捆绑包中,这也再次成为依赖项。
I posted a tutorial to explain keeping things organized when you have multiple targets.
Follow it.
http://www.madnikblog.com/blog/2013/09/19/organize-xcode-project-with-multiple-targets/
Simple idea is.
All the logic lives in a static library which is indeed dependency target of each executable targets.
All the Resources stay in a bundle which also a dependency again.