About Controls

A control is a view that is designed specifically for user interaction. A control is implemented as a subclass of NSControl, which is a subclass of NSView. Controls are not part of the controller layer, so keep the terms control and controller separate in your mind. It may help to think of controls as user controls.

In RandomPassword, you worked with two controls: NSButton and NSTextField. In RGBWell, you will use two more: NSSlider and NSColorWell.

NSControl inherits from NSView, which inherits from NSResponder, which inherits from NSObject. Each member of the family tree adds some capabilities (Figure 5.10).

Figure 5.10  Inheritance diagram for NSControl

NSControl adds the ability to ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.