在.pch文件中添加以下代码 //#define __OPTIMIZE__ #ifndef __OPTIMIZE__ #define NSLog(...) NSLog(__VA_ARGS__) #else #define NSLog(...) {} #endif 转载于:https://blog.51cto.com/aldridge1/850973