O'Reilly logo

Cocoa Design Patterns by Donald A. Yacktman, Erik M. Buck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

17. Outlets, Targets, and Actions

When you build a graphical user interface, you need a way to configure user interface objects, such as buttons, sliders, text fields, and menu items, and connect them to application-specific operations. For example, an application might provide a menu item to center selected text and another menu item to send a seating request to an airline reservation system. Finding a good way to connect user interface objects to application-specific operations is a common recurring problem.

One potential solution is to create application-specific subclasses of the user interface objects like menu items. For example, you could create a CenterTextMenuItem class and a SendSeatingRequestMenuItem class. However, there are a number ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required