O'Reilly logo

iOS 8 SDK Development, 2nd Edition by Janie Clayton, Chris Adamson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

println: The First Line of Defense Against Bugs

If you’ve spent time among other iOS developers or gone on Stack Overflow, you’ve probably heard someone mention the println method or its Objective-C predecessor, NSLog. This the first—and often the last, unfortunately—piece of debugging advice new developers receive. We first saw it way back in Logging, and have used it occasionally throughout the book, usually as a placeholder to make sure our app reached the new code we were writing.

The gist of println is that it will print a message to the console that only we will see. It might seem counterintuitive to create output that only we will see, but it is vitally important to have some means of verifying what is happening in our program.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required