In my memory, there’s some code that can let the NSLog not work when released.
I don’t want to remove my NSLog in my code.It helps a lot on debug mode.
So I want to find a way that can leave them in my code, and also don’t slow down the application when released.
Thanks for your help~~
A common way to remove all
NSLog(…)call in a release is to create a macro that is between conditional preprocessor macro and compiles to nothing, something like this:Put this code in a
.hfile that is included in every other file, like aDefines.hthat is#include‘d in the prefix header (.pch).RELEASEshould be a preprocessor macro defined against the Release configuration in the "Build Settings" tab of your target.Related Questions