有人可以讨论如何从应用程序的发布版本中豁免NSLog吗?此外,如果评论留在发布版本中,这是否重要?谢谢!
解决方法
Use a macro like
DLog
to wrap NSLog
,and turn it off in Release builds.
#ifdef DEBUG # define DLog(...) NSLog(__VA_ARGS__) #else # define DLog(...) /* */ #endif