Manuel Guesdon wrote:
Adding /** * Returns a pointer to the C function implementing the method used
"... to the implementation of the method ..."
* to respond to messages with aSelector by instances of the receiving * class. * <br />Raises NSInvalidArgumentException if given a null selector. */ + (IMP) instanceMethodForSelector: (SEL)aSelector { if (aSelector == 0) [NSException raise: NSInvalidArgumentException format: @"%@ null selector given", NSStringFromSelector(_cmd)]; /* * Since 'self' is an class, get_imp() will get the instance method. */ return get_imp((Class)self, aSelector); }
Thanks!
I've been meaning to track that down as soon as time permitted, as I've had a few reports on IRC about this but couldn't reproduce it in my tests as my objects weren't faulted.
Your solution is correct, but I personally would prefer an implementation using GSGetMethod as I recall there was some issues with meta classes and and some incompatible runtime functions between gnu and apple runtime, but I think this was only for class methods so it's probably irrelevant here. Maybe you can add a "FIXME: Should use GSGetMethod" and I'll look at it later.
Thanks for fixing this!
Cheers, David
_______________________________________________ Gnustep-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/gnustep-dev
