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

Part 1: Language > Sending Messages

Chapter 6. Sending Messages

Sending messages (calling methods) is fundamental to programming. You already know the basics of Objective-C messages. This chapter delves into the mechanics of how messages are sent, describes three different techniques for invoking methods programmatically, and explains how to write methods that accept a variable number of arguments. It isn't absolutely necessary to understand these topics in detail, but expanding your knowledge makes technologies like notifications, actions, remote invocation, and Key-Value Observing a little more comprehensible.

As briefly explained in Chapter 3, methods in Objective-C are not called in the Java sense. Messages are sent to objects via a dynamic dispatching function. Sending a message to an object involves (approximately) these steps:


  

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