I have an Xcode project which has lots of NSLog statementS.
I have to submit my app to get approval from Apple, and I would like to remove all NSLog statementS which I had used for debugging.
I want to remove only NSLog statements.
In Xcode, you can use Find and Replace and provide a regular expression something like:
NSLog.*;
Put this in your prefix header......
#ifndef __OPTIMIZE__
# define NSLog(...) NSLog(__VA_ARGS__)
#else
# define NSLog(...) {}
#endif
You can remove your NSLog statements using sed and grep. The basic idea is to grep
all lines containing NSLog statements and then delete them using sed
.
Using sed and grep might be new to you, but it's very helpful in the long run!
Here's some code I think should work, but backup your work first:
grep -Ev 'NSLog'
.
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