Build Configuration

Discussion in 'Mac Programming' started by davbeck, Oct 17, 2009.

  1. macrumors regular

    Joined:
    May 16, 2008
    Location:
    Reno, NV
    #1
    Is there any way to get access to the active build configuration in my code? I would like to add in some debugging statements if the configuration is debug like so:

    #ifdef DEBUG
    //log something
    #endif
     
  2. macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    In XCode, go to your project settings. Under the build tab, look for Preprocessor Macros. Set a variable (no need for an =x if you just want to use #ifdef) there for your debug build configuration, and do not define it for your release setting. Then you can use #ifdef and put in the name of the variable you defined to put in your debugging statements.

    -Lee
     
  3. thread starter macrumors regular

    Joined:
    May 16, 2008
    Location:
    Reno, NV

Share This Page