Dispatches an action message to the specified target.
SDK
- macOS 10.0+
Framework
- App
Kit
Declaration
- (BOOL)tryToPerform:(SEL)action with:(id)object;
Parameters
aSelector
The action message you want to dispatch.
anObject
The target object that defines the specified selector.
Return Value
YES
if either the receiver or its delegate can accept the specified selector; otherwise, NO
. This method also returns NO
if a
is nil
.
Discussion
The receiver tries to perform the method a
using its inherited try
method of NSResponder
. If the receiver doesn’t perform a
, the delegate is given the opportunity to perform it using its inherited perform
method of NSObject
.