打包发布去除NSLog

来源:互联网 发布:兴义农村淘宝招聘 编辑:程序博客网 时间:2024/05/24 01:10

#ifdef DEBUG

#define NSLog(...) NSLog(__VA_ARGS__)

#define debugMethod() NSLog(@"%s",__func__)

#else

#define NSLog(...)

#define debugMethod()

#endif

放入pch  打包项目前  调整: editScheme  -release

"Target > Build Settings > Preprocessor Macros > Debug"里有一个"DEBUG=1"

 

意思是说DEBUG模式  NSLOG有效;

 

release模式即为发布模式, NSLOG无效;


0 0
原创粉丝点击