How do I declare a debug only statement

前端 未结 4 1969
说谎
说谎 2021-01-31 02:44

In C# I can use the following code to have code which only executes during debug build, how can I do the same in Xcode?

#if DEBUG
{
    // etc etc
}
#endif
         


        
4条回答
  •  心在旅途
    2021-01-31 03:18

    There is a very useful debugging technote: Technical Note TN2124 Mac OS X Debugging Magic http://developer.apple.com/technotes/tn2004/tn2124.html#SECENV which contains lots of useful stuff for debugging your apps.

    Tony

提交回复
热议问题