|
From: | David Ayers |
Subject: | Re: Make GSObjCMethodNames() more general ? |
Date: | Sun, 25 Apr 2004 17:25:18 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 |
Yen-Ju Chen wrote:
Hi, I try to use GSObjCMethodNames() in GSObjCRuntime.h to get both class and instance methods.First, the comment in the source code said it will return class methods if the message is a class.But after a short test, it seems not the case. It always return instance methods.
Hmm, I can't confirm that. My tests show that it returns class methods when given a class. Be aware that the root classes are treated special in ObjC in the sense that all instance methods are also class methods.
Second, it always return the methods of super-class recursively. Is it possible or worth to make it more general, such as NSArray *GSObjCMethodName(id obj, BOOL recursive) so that user can decide whether to get methods up to super class ?
I don't think that we would want to change that function. But we have similar situation wrt GSGet(Instance/Class)Method(NotInherited) so I could imagine a GSObjCMethodNamesNotInherited(). Personally I'd prefer to add Instance/Class variants which each take a class because I'm not really thrilled about having to create an instance just to be able to query the instance method names, but I don't feel strongly about it.
What do others think? Cheers, David
[Prev in Thread] | Current Thread | [Next in Thread] |