[Openmcl-devel] how to call superclass's class-method in ObjC-bridge.

R. Matthew Emerson rme at clozure.com
Wed Jan 15 16:50:30 PST 2014


On Jan 15, 2014, at 5:30 PM, Park SungMin <byulparan_eng at icloud.com> wrote:

> 
> I like objc:defmethod and call-next-method. but I need override to class-method.
> 
> (ccl::define-objc-class-method ((:<bool> :needs-display-for-key (:id key)) my-ca-layer)
>  	;;; how to call super’s method?
>  )
> 
> maybe call-next-method is local function in objc:defmethod. so I can’t use it..
> 
> How to call super’s method(class method) ?

(defclass my-ca-layer (ns:ca-layer)
  ()
  (:metaclass ns:+ns-object))

(objc:defmethod (#/needsDisplayForKey: #>BOOL) ((self +my-ca-layer) string)
  (if (#/isEqualToString: #@"myKey" string)
    t
    (call-next-method string)))

Maybe the "+my-ca-layer" (with the plus sign prefix) is the trick you've been missing?




More information about the Openmcl-devel mailing list