码迷,mamicode.com
首页 > 其他好文 > 详细

NSLog 去除上线版本

时间:2016-08-21 22:51:54      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

创建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 一样 在相同的位置设置相对应功能;

 

NSLog 去除上线版本

标签:

原文地址:http://www.cnblogs.com/tony0571/p/5793776.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!