Xcode——当我有多个目标时让事情井井有条

发布于 2024-09-06 01:57:20 字数 333 浏览 0 评论 0原文

这个非常有用的答案解释了如何在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

痴意少年 2024-09-13 01:57:20

听起来多个项目是可行的方法,特别是当您有大量仅与一两个目标相关的文件时。这也意味着每个项目只能拥有一个类的一个版本,仅构建使用该版本的目标。当依赖目标位于不同项目中时,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.

残龙傲雪 2024-09-13 01:57:20

我发布了一个教程来解释当您有多个目标时如何保持事物井井有条。

关注它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文