How to know if NSAssert is disabled in release builds?

前端 未结 7 737
长发绾君心
长发绾君心 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 11:46

    Update: Verified this works in Xcode 8 as well.

    In Xcode 7, go into the project build settings and search for "Assert" in the search bar. This shows section "Apple LLVM 7.0 - Preprocessing" section. There is a setting named "Enable Foundation Assertions".

    I have successfully enabled/disabled NSAssert from there.

提交回复
热议问题