|
From: | David Ayers |
Subject: | Re: [GDL2] NSAutoreleasePool/EOFault |
Date: | Sat, 12 Mar 2005 19:13:04 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |