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 calls. Is this possible? Is there an easy way to do this?
wait there is far more simple method. Just add the following lines when you dont need NSLOG to your constants file
#define NSLog //
and comment it when you need it.
EDIT: In latest Xcode, you get error on above statement. So I figured out the best way is
#define NSLog(...)
Update:
The answer bellow is actually much better. See here.
Initial answer:
There is a little hack that you could do. Search for all NSLog
and replace them with //NSLog
and than do another search for ////NSLog
and replace them with //NSLog
.
#define NSLog if(1) NSLog
if you dont want log set 1 as 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With