Instance Method


Returns the target object that responds to an action.


- (id)targetForAction:(SEL)action withSender:(id)sender;



A selector that identifies a method associated with a command.


The object calling this method. For the editing menu commands, this is the shared UIApplication object. Depending on the context, you can query the sender for information to help you determine the target of the command.

Return Value

The object whose action method is invoked to execute the command.


This method is called whenever an action needs to be invoked by the object. The default implementation calls the canPerformAction:withSender: method to determine whether it can invoke the action. If the object can invoke the action, it returns itself, otherwise it passes the request up the responder chain. Your app should override this method if it wants to override how a target is selected.

See Also

Building and Validating Commands

- validateCommand:

Asks the receiving responder to validate the command.

- canPerformAction:withSender:

Requests the receiving responder to enable or disable the specified command in the user interface.