//XCODE 调试输出语句相关控制
//在 "Target > Build Settings > Preprocessor Macros > Debug" 里有一个"DEBUG=1"。
//设置为Debug模式下,Product-->Scheme-->SchemeEdit Scheme
//设置Build Configuration成Debug时,就可以打印nslog了。
//设置Release,发布app版本的时候就不会打印了,提高了性能
#ifdef DEBUG
#define debugLog(...) NSLog(__VA_ARGS__)
#define debugMethod() NSLog(@"%s",__func__)
#else
#define debugLog(...)
#define debugMethod()
#endifhttp://blog.csdn.net/lihangqw/article/details/8657743
本文详细介绍了如何在Xcode中通过预处理器宏来控制DEBUG模式下的打印语句,包括自定义debugLog和debugMethod函数,以及如何在构建配置中实现DEBUG模式下打印nslog,而在发布版本时不打印。
1万+

被折叠的 条评论
为什么被折叠?



