Suppressing NSLog statements for release?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-04-12T16:04:48Z Indexed on 2010/04/12 16:43 UTC
Read the original article Hit count: 503

Filed under:
|
|
|

I wonder if someone could help me setup a number of NSLog statements so they print to console when executing in "Debug Mode" but don't print in "Release Mode". I understand I need to add something like DEBUG = 1 to the debug config in Xcode but I can't find where. Also how do I utilise this in my code?

NSLog(@"Print Always");
if(DEBUG) NSLog(@"Print only in debug");

Is there a simple way of doing this?

EDIT:

I tried following this but when I entered either:

OTHER_CFLAGS or GCC_PREPROCESSOR_DEFINITIONS

Xcode informed me that "theres already another key named .... "

alt text

gary

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa