targetaction
Targetaction, often written as target-action or target-action pattern, is a user interface programming pattern in which a control or view (the sender) is configured with a target object and an action, typically a method or selector, to be invoked in response to a user event such as a click or tap. The pattern enables the control to delegate behavior to another object without embedding the logic inside the control itself.
In practice, the control stores a reference to the target and a representation of the action. When
Origins and platforms: The mechanism originated in NeXTSTEP and early Apple Cocoa frameworks; in Cocoa and
Variants and usage: A single action method can be shared by multiple controls; a single control can
Advantages and caveats: It promotes decoupling of UI from behavior and simplifies reuse, but it relies on