Mac OS X Developer's Guide

Chapter 19: Making It Happen: Events, Responders, Delegates, and Notification

Overview

Having dealt with the big picture (applications) and the smallest building blocks, it is time to turn to how they work together. This chapter examines how the application and its objects animate those building blocks and the more complex objects that you create in your applications.

The most basic concept in this chapter is that of events they cause the application to take some action. Sometimes they are initiated by users (mouse clicks, for example), and other times they are generated by the application itself. (They also can arrive from the operating system or from other applications.)

Objects in your application respond to events. Called responders, they include views, buttons, and other interface elements.

Delegates provide a way for an application and its objects to pass events along to other interested objects.

The notification system in Cocoa does just what its name implies: It allows one object to automatically notify others (which it may not even know about) when something has happened.

Note that a number of the concepts in this chapter are required to implement toolbars. The complete code for implementing toolbars is given in Chapter 20; see Implementing Toolbars on page 440.

Events

In all graphical user interface frameworks, events provide a mechanism for managing the event loop and for letting the application and its objects know when something needs to be done. Events always are a request for an application to do something if it deems it appropriate. The application may decide not to process...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Fire Alarm Control Panels
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.