Reputation: 11390
I have found a set of great macros here Objective C Macros
I put the:
#if DEBUG==1
#define .... macros
in my header file.
Now I simply can't figure out where to set DEBUG=1 or DEBUG=0 in Xcode so that it will define the macro when debugging and not when releasing.
Hope someone can help me find the missing drop down menu:)
Upvotes: 4
Views: 3149
Reputation: 70254
EDIT:
Ok apparently, when working on an iPhone application, you have to:
Edit your project or target settings, select your Debug
configuration then look for the "Preprocessor Macros" settings and type DEBUG=1
However, I would rather define NDEBUG
in the Release
configuration then write
#ifndef NDEBUG // if we are in debug mode
#define bla bla bla
#endif
Note: you need to have a target that compiles Objective-C source files to a library or application properly set up; otherwise the settings don't appear in the UI.
Upvotes: 2