Defining an Objective-C class introduced the define-objc-class macro with the
class option for naming the Objective-C class. Since this macro is like
, it can specify any number of superclasses from which the Lisp class will inherit and also provides a way for superclass of the Objective-C class to be chosen:
:objc-superclass-nameclass option can be used to specify the superclass explicitly.
NSObjectis used as the superclass.
For example, both of these definitions define an Objective-C class that inherits from
in the case of
and explicitly for
(define-objc-class my-special-object (my-object)
(define-objc-class my-other-object ()
The set of methods available for a given Objective-C class consists of those defined on the class itself as well as those inherited from its superclasses.