O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

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

Runtime Errors

Despite your best efforts, things will sometimes go wrong while your app is running. In Cocoa, these errors fall into two categories.

Programmer errors are situations that should never happen, which means that they are the result of, well, a mistake you made. (We say they should never happen… but we have made plenty of these.) Examples include not meeting the precondition of a method (the index was not within the array’s bounds), performing an illegal operation (such as force-casting incorrectly or force-unwrapping a nil), or sending a message to an Objective-C object that does not understand it.

Swift alerts you to programmer errors by trapping, which results in stopping the program. Cocoa APIs use Objective-C ...

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