If you want your NSLog to work only when your are debugging and you don't want to do any changes to your code the best approach is to do this on your .pch file:
#ifndef DEBUG
#define NSLog(x...)
#endif
EXPLANATION AND TROUBLESHOOTING:
This means that if DEBUG is not defined it will "override" all NSLogs to do nothing, this string replace takes place before compiling so no NSLog in the whole code will escape, no NSLog will be left on production by mistake, this eliminates the human error of forgetting to remove NSLogs on production apps.
DEBUG is normally defined in debug mode by default in all Xcode projects. you can find out if it is defined at:
Build Settings ->
Apple LLV #.# - Preprocessing ->
Preprocessor Macros -> Debug
if it is not there add
DEBUG=1
also if you don't have a pch file or is not wired up here's what you got to do (because it was automatically added in xcode 5 but is no longer added in xcode 6 and up by default on the new project templates)
Why isn't ProjectName-Prefix.pch created automatically in Xcode 6?
NSLog()
in iOS is just a local debug tool. – Relinquish