All Manuals > LispWorks Objective-C and Cocoa Interface User Guide and Reference Manual > 2 Objective-C Reference

can-invoke-p Function

Summary

Checks whether a given Objective-C method can be invoked.

Package

objc

Signature

can-invoke-p class-or-object-pointer method => flag

Arguments
class-or-object-pointer
A string naming an Objective-C class, a pointer to an Objective-C foreign object or the result of calling current-super.
method
A string naming the method to invoke.
Values
flag
A boolean.
Description

The function can-invoke-p is used to check whether an Objective-C instance or class method can be invoked (is defined) for a given class or object.

If class-or-object-pointer is a string, then it must name an Objective-C class and the class method named method in that class is checked. If class-or-object-pointer is the result of calling current-super then the instance method named method is checked for the superclass of the current method. Otherwise class-or-object-pointer should a foreign pointer to an Objective-C object or class and the appropriate instance or class method named method is checked. The value of method should be a concatenation of the message name and its argument names, including the colons, for example "setWidth:height:".

The return value flag is nil if the method cannot be invoked and t otherwise.

See also

invoke


LispWorks Objective-C and Cocoa Interface User Guide and Reference Manual - 01 Dec 2021 19:38:32