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 ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.