设置DEBUG, 使用宏定义: #if DEBUG NSLog(@"debug model"); #else //执行release模式的代码 #endif 转载于:https://www.cnblogs.com/sunjianfei/p/6668684.html