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

  

原文地址:https://www.cnblogs.com/ioriwellings/p/6189708.html