代码改变世界

随笔分类 -  iOS开发

NSLog 宏

2012-09-16 19:28 by Orin, 217 阅读, 收藏, 编辑
摘要: 在头文件中加入如下宏就可以实现只在调试模式下输出调试信息,提高Relase性能。1 #ifndef __OPTIMIZE__ 2 # define NSLog(s, ...) NSLog( @"<%s : (%d)> %@",__FUNCTION__, __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) 3 #else 4 # define NSLog(...) {} 5 #endif 阅读全文