简体   繁体   English

内置预处理器令牌可检测iPhone应用程序目标

[英]Built-in preprocessor token to detect iPhone app target

I need to set up correctly the FIRM ID for my app(according to target).For example I wrote in my Distribution.h the following lines: 我需要为我的应用正确设置FIRM ID(根据目标),例如我在Distribution.h中写了以下几行:

#define X_FIRM_ID @"X"
#define XX_FIRM_ID @"XX"

#define FIRM_ID XX_FIRM_ID

For each build that I made I must manually change the FIRM_ID.I want to this automatically, just like I do for Default.png and other images used in my apps. 对于我制作的每个版本,我都必须手动更改FIRM_ID。我想要自动更改为FIRM_ID,就像我对Default.png和我的应用程序中使用的其他图像一样。 I have 2 targets: one for X and another one for XX.In each target I filled the Preprocessor macros with X and XX accordingly. 我有2个目标:一个针对X,另一个针对XX。在每个目标中,我分别用X和XX填充了预处理宏。

Now I want to define in Distribution.h the FIRM_ID accordingly with the preprocessor macro and I don't know how to do this. 现在,我想在Distribution.h中用预处理器宏定义FIRM_ID,我不知道该怎么做。

#define FIRM_ID if defined(XX) XX

The above one do not work. 以上一项不起作用。

Please help me with this, if it can be done. 如果可以的话,请帮我。

There are several ways to do this, here are two: 有几种方法可以做到这一点,这里有两种:

  • In your target info, under build, set Preprocessor macros 在目标信息的构建下,设置Preprocessor macros
  • Import different Prefix headers for the two targets 为两个目标导入不同的Prefix headers

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM