NSLog 去除上线版本

创建pch 文件

STEP1:

#ifdef DEBUG

#   define NSLog(...) NSLog(__VA_ARGS__)

#else

#   define NSLog(...)

#endif

#define ALog(...)  NSLog(__VA_ARGS__)

 

STEP2:

a. TARGETS 中 Build Settings 设置 Apple LLVM7.1 - Preprocessing 里面 Preprocessor Macros ;

如果在测试版本打印日志,Debug 填写 Debug  ; Relase 不填写

如果在上线版本打印日志,Release填写 Relase ; Debug 不填写

b.PROJECT 一样 在相同的位置设置相对应功能;

 

posted on 2016-08-21 22:10  Tony0571  阅读(157)  评论(0编辑  收藏  举报

导航