NSLog 宏
2012-09-16 19:28 Orin 阅读(220) 评论(0) 编辑 收藏 举报在头文件中加入如下宏就可以实现只在调试模式下输出调试信息,提高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