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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 5. Messaging > Message Forwarding

Message Forwarding

What happens if objc_msgSend gets to the top of the object hierarchy without finding a method implementation that corresponds to the selector in the message? If that happens, objc_msgSend calls the forwardInvocation: method of NSObject with an NSInvocation argument (see the sidebar NSInvocation) formed from the original message expression. NSObject’s implementation of forwardInvocation: invokes the NSObject method doesNotRecognizeSelector:.

The NSObject’s implementation of doesNotRecognizeSelector: raises an exception and logs an error message, and then your program crashes.


  

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