How to know if NSAssert is disabled in release builds?

前端 未结 7 742
长发绾君心
长发绾君心 2020-12-04 11:22

I often saw \"assert \" in iOS code, I google it, and got to know it assert true or false.

I want to know if this will auto disable in release mode?

7条回答
  •  旧巷少年郎
    2020-12-04 12:09

    Asserts are conditionally compiled out of your code when NDEBUG is defined. If you define NDEBUG=1 in the corresponding build settings section, you will deactivate asserts in your code regardless of the release or debug mode.

提交回复
热议问题