How can I add an #ifdef DEBUG to Xcode?

后端 未结 2 1439
长情又很酷
长情又很酷 2021-02-04 01:46

I have some code in a project which should never be used in the release build, but is useful when testing. I\'d like to do something like this:

#ifdef DEBUG
             


        
2条回答
  •  你的背包
    2021-02-04 02:01

    In recent Xcode project templates there’s already a DEBUG=1 macro defined for the Debug build configuration (in the Preprocessor Macros section). You can test it using the #if preprocessor directive.

提交回复
热议问题