Sends an action message identified by selector to a specified target.
- iOS 2.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
A selector identifying an action method. See the discussion for information on the permitted selector forms.
The object to receive the action message. If
nil, the app sends the message to the first responder, from whence it progresses up the responder chain until it is handled.
The object that is sending the action message. The default sender is the
UIControlobject that invokes this method.
UIEventobject that encapsulates information about the event originating the action message.
true if a responder object handled the action message,
false if no object in the responder chain handled the message.
Normally, this method is invoked by a
UIControl object that the user has touched. The default implementation dispatches the action method to the given target object or, if no target is specified, to the first responder. Subclasses may override this method to perform special dispatching of action messages.
By default, this method pushes two parameters when calling the target. These last two parameters are optional for the receiver because it is up to the caller (usually a
UIControl object) to remove any parameters it added. This design enables the action selector to be one of the following:
- (void)action:(id)sender for