IOS release 版本的时候 去掉输出log NSLog

在.pch文件中添加下面一段

#ifndef __OPTIMIZE__

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

#else

#define NSLog(...) {}

#endif

如何添加 pch 文件,xcode - new file -pch file。   将Precomplie Prefix Head  修改为 yes    将 Prefix Header路径设置为 $(SRCROOT)/xxxx.pch

原文地址:https://www.cnblogs.com/rollrock/p/4603679.html