And now it’s time to discuss every programmer’s favorite pastime: debugging by printing to the console. Whether it’s using printf, System.out.println, cout, Console.writeln, echo, print, or NSLog, printing out values to debug a program is as old and sacred as programming itself. My official stance is that you should use GDB everywhere you can, but let’s face it: sometimes you just feel like throwing in an NSLog to see what’s going on. Also, as mentioned previously, there are some cases where using NSLog in your app is a debugging necessity.
So instead of pushing you firmly away from using NSLog to debug, I’ll give you some tips on how to use it effectively.
NSLog Syntax and Formatting
To truly master NSLog, you must understand the ...