Re: Recovering a list of selectors to which an object can respond
Re: Recovering a list of selectors to which an object can respond
- Subject: Re: Recovering a list of selectors to which an object can respond
- From: Chris Hanson <email@hidden>
- Date: Tue, 18 Sep 2007 11:17:56 -0700
On Sep 18, 2007, at 11:07 AM, Gustavo Vera wrote:
Answering to myself, I believe that here is the solution
http://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html#/
/apple_ref/c/func/class_nextMethodList
Note that getting the methods implemented on a class is not the same
as getting the messages that the class or an instance of that class
can respond to. Even if you get the superclass methods too (and so on
up the chain), the class may choose to handle messages at runtime that
it has no explicit method for.
In general, it's better to ask a class if it can respond to a
particular message than to ask it for a collection of methods. What
higher-level task are you really trying to accomplish by asking a
class for its subclasses or its methods?
-- Chris
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden