In the process of project development, often encountered in the debugging time to print log, but on-line or release do not need to show the log, at this time you worked hard to write so many log, you either manually commented out, or set a switch variable, try to use the total switch to open. You can actually make full use of the macro definition to set it up.
The step is simple, only need to append your corresponding macro definition in projectname_prefix.pch, can use directly without import.
The macro definition is as follows:
[Plain]View Plaincopy
- #ifdef DEBUG
- #define LOG (...) NSLog (__va_args__);
- #define Log_method NSLog (@ "%s", __func__);
- #else
- #define LOG (...); #define Log_method;
- #endif
Once this is set up, you only need to select the product->scheme->edit Scheme->info, release, or Debug version. If the debug version, then agree to log, if the release version is not printed.
Our release to AppStore is the release version, which is simply the difference between the two versions.
Release is a release version, smaller than the debug version, they call two different bottom-level libraries, debug contains more information, can be breakpoint debugging, stepping, using debug output statements such as using Trace/assert,
However, the release version does not contain debugging information and runs faster.
In addition, the debug parameters set here can be set in the following path: Engineering->target->build Setting->preprocessor Macros. The default system has given the debug parameters. If you want to add new parameters, then where to increase.
During iOS development, the NSLog macro defines