Where to find info on removing debugging code?

Discussion in 'Mac Programming' started by chrono1081, Sep 27, 2010.

  1. macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #1
    Hi guys.

    I've never written lots of debugging code before (probably because I am only a hobbyist ;) ) but now that my projects are getting quite large I decided to start doing so.

    I know in some IDEs you can put a symbol or special syntax in front of a line of code (like a line that writes to console or something) and with one command you can remove all of it from the final build. I'm sure XCode has a similar feature but I can't seem to find it anywhere.

    I've never used it so maybe its done with a macro instead of in the IDE but I know people out there do it and I want to start since it will make my life easier:D

    Does anyone know what I'm talking about or have any tips where I can find such information? I'm not having much luck : /
     
  2. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    You could just incase your debug code in:

    Code:
    #ifdef DEBUG
    // insert code here
    #endif
    and then just delete the define for the production build.
     
  3. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3

Share This Page