How to specify DEBUG definition in project build settings?

I am trying to implement a registration approach at http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ . I am not sure how to complete the step:

Therefore, the first line is a switch to make sure that we are in debug mode. I set this value in the build settings of my project. If you look at the "Preprocessor Macros" you can set the DEBUG definition there.

This means that your code has the entry "#ifdef DEBUG" (I give only the first line).

QUESTION: How do I configure this DEBUG flag in project settings?

For example, I tried:

  • go to preprocessor macros
  • go to position DEBUG
  • in the value placed in "-DEBUG = 1"
  • this doesn't seem to work - it executes and executes, but the note appears in the log when I have this line of code.
DLog(@"testingg");
+2
source share
2 answers

If you edit the assembly parameters directly through the Xcode interface, the value is only DEBUG = 1 (no -). This is just a separation space if you have more than one.

I prefer to use xccongif files to control my build settings, in which case you use the "Based" drop-down list in the lower right corner of the build settings to indicate which xcconfig file to use, and in the xcconfig file use the following example (the example also shows the setting of the icon log level):

GCC_PREPROCESSOR_DEFINITIONS = TTMAXLOGLEVEL=TTLOGLEVEL_INFO DEBUG=1
+1
source
0

All Articles