Runtime question - Special requirements to register overridden methods?
Runtime question - Special requirements to register overridden methods?
- Subject: Runtime question - Special requirements to register overridden methods?
- From: Sherm Pendley <email@hidden>
- Date: Tue, 1 Jul 2003 07:42:30 -0400
Here's the situation:
I write and maintain a "foreign" language bridge. The code for that
bridge creates and registers a number of classes with the Objective-C
runtime. Classes are (seemingly) registered correctly. I can create and
initialize instances of them, and messages sent to them (from either end
of the bridge) result in the correct calls to my implementation function.
With one exception, that is. Inherited methods are correctly sent to the
super class, and new methods that don't exist in the super class are
correctly called in my new sub class. But, super class methods that are
overridden in my sub class aren't called when I message them from
Objective-C - no call is ever made to the registered implementation
function in that case.
I have gone over and over the registered class structure, both before
it's sent to objc_addClass() and when it's returned from
objc_getClass(), with no luck. I've tried registering the method list
along with the class, and adding it later with class_addMethods(), with
the same result either way.
The one example I've been able to find, in Apple's "The Objective-C
Programming Language," is of no help; it leaves the method lists empty,
with the comment "We can add methods later." Unfortunately, "later"
never seems to arrive - the class_addMethods() function has only a terse
description and no example code.
Can anyone point me to a better example of registering a class,
including methods - preferably, methods that override those in the super
class? Is there any special magic required to register such methods,
beyond the basic selector, signature, IMP information?
sherm--
"I have no special gift, I am only passionately curious." - Albert
Einstein
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.