Xcode DEBUG Mode - when is it on/off?

前端 未结 2 659
心在旅途
心在旅途 2021-01-01 12:56

I have noticed that this works in dev mode (testing on the simulator, etc):

#ifdef DEBUG
    //do stuff
#endif

But when I archive and distr

2条回答
  •  爱一瞬间的悲伤
    2021-01-01 13:21

    The current version of Xcode automatically sets the DEBUG macro in new projects. It does this only for Debug build mode however.

    You can edit this in your projects Build Settings.

    I recommend you add a new, separate macro instead of editing the DEBUG one. Maybe you could add a DISTRIBUTION or DEPLOYMENT macro only for the release mode.

    enter image description here

提交回复
热议问题