Controls

All Cocoa controls are subclasses of the NSControl class, which is in turn a subclass of NSView. The NSControl class is an abstract class and should not be instantiated. Understanding it is necessary to effectively use its subclasses, however.

The NSControl class performs three key functions. It must be able to draw the user interface element that it represents. The machinery to support this task is inherited from NSView. It also needs to be able to respond to user input, in particular from the mouse and keyboard. This capability is inherited from the NSResponder class. Finally, a control needs to be able to send arbitrary action messages to arbitrary targets. This capability is added in the NSControl class itself.

NSControl Class ...

Get Cocoa® Programming 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.