nslog

今天有人问我怎么更好的使用nslog,打包的时候老注释

pch里加下面的代码就好了平时debug的时候打印,release后就不打印了

#ifdef DEBUG
#define NSLog(...) NSLog(__VA_ARGS__)
#define debugMethod() NSLog(@"%s", __func__)
#else
#define NSLog(...)
#define debugMethod()
#endif

原文地址:https://www.cnblogs.com/abl1992/p/4891128.html