Obj-C subclassing behavior
I have a possible bug, but wondering if this was normal (or even desired) behavior in the :objc package... I've created a framework using Cocoa and created a simple class like so:
@interface foo : NSObject { }
- (void)bar: (id)anObject;
- (void)setup;
@end
And it is implemented.
In LW, I then want to sublcass this and send -bar: messages to it. So, I go for it:
(define-objc-class my-foo ()
()
(:objc-class-name "my-foo")
(:objc-superclass-name "foo"))
Now I'll override -setup (that the framework will call automagically when I use the object):
(define-objc-method ("setup" :void)
((self my-foo))
(invoke self "bar:" nil))
The above call to -bar: will now either crash with an unrecoverable error that's something like "<object my-foo> is an invalid parameter to function null-pointer-p". Please note that the two additional pieces of info:
(let ((o (alloc-init-object "my-foo")))
(can-invoke-p o "bar:"))
--> T
Also, if I change the call in the setup method to:
(invoke (current-super) "bar:" nil)
Everything works as expected. Any ideas?
Jeff M.