我应该复制 xcode 项目还是#define 部分?

发布于 2024-10-07 03:50:01 字数 331 浏览 0 评论 0原文

我有一个 iPad 应用程序,可以有几种不同的可发布版本,我正在尝试决定如何最好地制作这些替代版本。它们在源代码方面只有一些区别,主要区别在于资源数据文件(xml 和大量二进制文件)。

1)我应该复制该项目并分支少数源文件并为每个文件分别包含适当的资源吗?当我向项目添加文件并执行除编辑共享文件之外的其他基本操作时,这似乎更像是维护麻烦。

2)或者我应该随时使用#defines构建我想要的适当风格,然后相应地ifdef整个文件?这看起来更简单,但我怀疑我无法找到一种简单的方法来排除/包含资源文件,这将是一个交易破坏者。

关于如何处理选项 2 中的资源问题有什么建议,或者是否有更好的替代方法?

I have an iPad app that can come in several different releasable flavors, and I'm trying to decide how to best make these alternate releases. They have only a few differences source-code wise, and primarily differ in resource data files (xml and a very large amount of binary files).

1) Should I duplicate the project and branch the handful of source files and include the appropriate resources separately for each? This seems more of a maintenance hassle as I add files to the project and do other basic things other than edit shared files.

2) Or should I use #defines to build the appropriate flavor I want at any time, then ifdef out entire files accordingly? This seems simpler but my suspicion is that I won't be able to find an easy way to exclude/include resource files, and that would be a deal breaker.

Any suggestions on how to deal with the resource issue in option 2, or if there is an alternate approach altogether that is better?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

踏雪无痕 2024-10-14 03:50:02

在单个 XCode 项目中创建单独的目标怎么样?

使每个目标包含适合该应用程序的文件;这样就不需要 ifdef 了。

What about creating separate targets within a single XCode project?

Make each target include the files that are appropriate for that app; no need for ifdefs that way.

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