美文网首页
debug/release模式

debug/release模式

作者: 武一顶顶 | 来源:发表于2016-12-02 14:55 被阅读10次
打开DEBUG 模式: DEBUG = 1   
关掉DEBUG 模式:  DEBUG =0 
#if DEBUG
       ......  模拟数据    
#else
        ...... 真实数据 
#endif
  • 例:

#ifdef DEBUG
# define NSLog(fmt, ...) NSLog((@"%s -%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
# define NSLog(...) {}
#endif
  • 例:
#ifdef DEBUG
    return @"http://111.22.6666.667:8888/dxxxx-api/v1/";
#else
    return @"http://api.devicemmmm.com:80/dxxxxx-api/v1/";
#endif
  • 如图所示,开启/关闭preprocessor macros(预编译宏指令开关)


    D815BD51-B799-419C-B2FA-D35794C9A86F.png

相关文章

网友评论

      本文标题:debug/release模式

      本文链接:https://www.haomeiwen.com/subject/iuqqmttx.html