Enabling the macro value "DEBUG"

In my code, I want to conditionally perform several operations with:

#ifdef DEBUG
NSLog(@"I'm in debug mode");
#endif

I configured Project-> Edit Project Settings-> Build tab so that "DEBUG" is specified as a user parameter with a value of 1. Debug is selected in the "Configuration" drop-down list. This still does not include the Debug build directive, although I thought it would.

What else do I need to do at the build stage to resolve this?

+3
source share
3 answers

To do this, you need to set the compiler flag.

, , , Debug ( ) C ++ ( Xcode 3.1 GCC 4.2 - ).

: -DDEBUG .

DEBUG , .

+10

project → settings → c/++ ( ?) DEBUG , .

0

SDK 3.0, 2.2.1 XCode 3.1.

This link did the trick for me, complete with pictures!

0
source

Source: https://habr.com/ru/post/1711214/


All Articles