Setting a flag in compiler for NSLog not to show

后端 未结 7 1651
野趣味
野趣味 2021-01-21 18:55

Is there any particular flag which can be set to not display NSLog output in either debug or release?

Thanks.

7条回答
  •  轮回少年
    2021-01-21 19:34

    You can define a macro in the precompiled header (.pch) to disable NSLog:

    #ifdef RELEASE
    #   define NSLog(...)
    #endif
    

    This disables NSLog in release builds.

提交回复
热议问题