Search code examples
iphoneiosobjective-cnslog

Will NSLog effect app's speed?


Possible Duplicate:
Do I need to disable NSLog before release Application?

In my iPhone app there are more than 20 classes.Every where I am printing so many values using NSLog.When I run my app on simulator it is bit low because of some NSLogs(specially printing NSData etc)

Will it be slow if I finished the app and run it on device after making the ipa file ? Or should I comment all the NSLogs from classes ?


Solution

  • instead of NSLog use DLog everywhere. When testing and debugging, you'll get debug messages. When you're ready to release a beta or final release, all those DLog lines automatically become empty and nothing gets emitted. This way there's no manual setting of variables or commenting of NSLogs required. Picking your build target takes care of it.