How do I disable NSLog?

前端 未结 15 2102
陌清茗
陌清茗 2020-12-05 07:46

I\'d like to do the following in Xcode:

Find all NSLog commands without comments, and replace it with //NSLog...

In other words, I want to comment all NSLog

15条回答
  •  借酒劲吻你
    2020-12-05 08:36

    I would do this

    #define EnableNSLog 1
    
    #if EnableNSLog == 0
    #define NSLog   //
    #elif EnableNSLog == 1
    #warning Disable NSLog
    #endif
    

    This should generate a warning message to remind me to disable NSLog before final release.

提交回复
热议问题