How do I disable NSLog?

前端 未结 15 2137
陌清茗
陌清茗 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:18

    I have to do a separate answer because I cant comment yet, but one thing you really need to be careful about when you do a find and replace is something like this:

    if(BOOL)
    NSLog(@"blah blah");
    
    [self doSomething];
    

    If you comment out the nslog, the conditional gets associated with the method below it, correct me if I'm wrong

提交回复
热议问题