O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

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

5Exceptions, Error Handling, and Signals

One of the grisly facts of programming life is that errors can happen, and program code must react to those errors and deal with them appropriately. With the Unix APIs, there are two primary ways that exceptional conditions are communicated to programs. One is through return codes from function calls plus a global variable that describes the error in more detail. The other is through signals sent to the program from the OS. The Objective-C compiler and Cocoa framework in Mac OS X also provide an exception-handling architecture that programs can take advantage of.

errno

Most of the library functions and system calls provided by Unix systems have a return value that signifies that an error happened during ...

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