You’re previewing Ry’s Cocoa Tutorial

The First Responder

In this chapter, we’re going to learn about that little red box at the top of the Document Outline:

The First Responder proxy object in Interface Builder

This is called the first responder, and it serves as a proxy for the target in the target-action pattern. Instead of connecting a UI component’s action to an explicit object, the first responder lets you connect it to a dynamic object that is determined at runtime.

This opens up all sorts of new ways to use UI components. For example, most menu items are connected to the first responder instead of directly to a controller object. This enables views, controllers, document subclasses, or even the application delegate to respond to the action.

After a brief conceptual overview of the responder chain, we’ll take a concrete look at why you would want to handle actions in all of these different objects.

Sorry, this is the end of the preview. To read the rest of this chapter, you’ll need to purchase Ry’s Cocoa Tutorial.

Mailing List

Sign up for my low-volume mailing list to find out when new content is released. Next up is a comprehensive Swift tutorial planned for late January.

You’ll only receive emails when new tutorials are released, and your contact information will never be shared with third parties. Click here to unsubscribe.