How to differentiate multiple targets with Xcode 4.2

三世轮回 提交于 2019-11-30 09:04:35

Use preprocessor macros to do this. Go to Target -> Build Setting and choose "All configurations" (this is very important). Next find field "Preprocessor Macros".

In this field, add the flag in ex. PAID_VERSION. Now you can use this flag in code:

#ifdef PAID_VERSION
    NSLog(@"Paid version");
#else
    NSLog(@"Lite version");
#endif
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!