Instance Method

tryToPerform:with:

Attempts to perform the method indicated by an action with a specified argument.

Declaration

- (BOOL)tryToPerform:(SEL)action with:(id)object;

Parameters

action

The selector identifying the action method.

object

The object to use as the sole argument of the action method.

Return Value

Returns NO if no responder is found that responds to action; otherwise, YES.

Discussion

If the receiver responds to action, it invokes the method with object as the argument and returns YES. If the receiver doesn’t respond, it sends this message to its next responder with the same selector and object.

See Also