iOS 宏条件编译

Posted 不及格的程序员-八神

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS 宏条件编译相关的知识,希望对你有一定的参考价值。

在工程的 build settings 中的 preprocessor macros 下, debug: DEBUG=1 TestApi=1

#if !defined (TestApi)
    
    config.baseUrl = @"https://121.42.156.51/";
    config.serverIP = @"https://121.42.156.51";
    config.serverPort = nil;
    
#else
    
    config.baseUrl = @"https://121.42.156.51:10443/";
    config.serverIP = @"https://121.42.156.51";
    config.serverPort = @"10443";
    
#endif

  在工程的 build settings 中的 preprocessor macros 下, debug: DEBUG=1

#ifdef DEBUG
    isProduction  = NO;
#else
    isProduction = YES;
#endif

  

以上是关于iOS 宏条件编译的主要内容,如果未能解决你的问题,请参考以下文章