方法1.点击xcode工程,有个Build settings 的选项,在这里有个Apple LLVM 6.1 preprocessing的选项,里面有个preprocess Macros添加自定义的预编译宏就可以了
方法2:在相对应的.h文件中添加
#ifdef _NDEBUG
#define DMLog(...) NSLog (@"%s %@",__PRETTY_FUNCTION__,[NSString stringWithFormat:__VA_ARGS__])
#else
#define DMLog(...) do{} while(0)
#endif