A definition of the fundamental behavior for controls, which are specialized views that notify your app of relevant events by using the target-action design pattern.
- macOS 10.0+
NSControl class is abstract and must be subclassed to be used. Although you can subclass it yourself, more often you use one of the subclasses already defined by AppKit. A control draws content on the screen, automatically handles user interactions with that content, and calls the action method of its target object for any significant user interactions.
About Delegate Methods
NSControl class provides several delegate methods for its subclasses that allow text editing, such as
NSMatrix. These include:
Note that although
NSControl defines delegate methods, it does not itself have a delegate. Any subclass that uses these methods must have a delegate and the methods to get and set it. In addition, a formal delegate protocol
NSControl also defines delegate methods used by control delegates.