Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Error and exception handling > NSError—handling errors the Cocoa wa...

10.1. NSError—handling errors the Cocoa way

In Cocoa and Cocoa Touch, nearly all methods that could possibly fail for reasons you as a developer can’t control take a pointer to an NSError pointer as their last parameter. Why a pointer to a pointer? Because that way the called method can create an instance of NSError and you can access it afterwards through your NSError pointer.

Before we go any further, let’s look at an example in the following listing.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint