NSLog is Not Your Friend On The IPhone

Posted by Tres Fri, 08 May 2009 06:35:00 GMT

While using the simulator to test and debug an IPhone app, NSLog does nothing to alter the performance of the app. So, if you’re like me, you may just leave all those NSLog calls in – even after they’re no longer serving a purpose. This is a twofold problem. First, and most evident, you’ll see a marked decrease in performance once you get the app on the IPhone. The decreased performance is actually a symptom of the second problem – all of those NSLog messages are being pushed to the device logs, no matter whether you’re compiling a ‘Debug’ or ‘Release’ build. So anyone installing your app will be able to see all your nice little debug messages too.

So I still like you, NSLog. Really. We go too far back to let something like this come between us. We just can’t be seen in public anymore.

Posted in ,  | Tags , ,