Error handling concepts in Objective-C with NSError

Apple provides an excellent 30,000 foot view of error handling in Objective-C using NSError, including examples to create your own NSError objects:

When you’re writing code with Objective-C, exceptions are used solely for programmer errors, like out-of-bounds array access or invalid method arguments. These are the problems that you should find and fix during testing before you ship your app.

This chapter gives a brief introduction to using NSError objects, including how to work with framework methods that may fail and return errors