Yes, the statement is executed if you left it in the release build.
So, it’s better to understand the NSLog comment in the release build or use DEBUG MODE as @Lithu TV said
By doing this, performance will get better. Because NSLog is pretty slow. NSLog will do two things: 1) write log messages to the system log (ASL) 2) if the application runs in xcode, it is also written to stderr.
The main problem lies in the first. To ensure thread safety, each time an NSLog is called, it opens a connection to an ASL object, sends a message, and closes the connection. The connection operation is very expensive. Another reason is that NSLog spends some time to get a timestamp for registration.
UPDATE: Also, I don’t think there is a direct way to check the log from the system, however there are some software tools that help to view the console log. The following might help you in displaying the console log: http://support.apple.com/kb/DL1465
I have never tried this myself. So I can’t give you a guarantee.
Neha
source share