• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Listing all selectors for an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Listing all selectors for an object


  • Subject: Re: Listing all selectors for an object
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Sun, 5 Mar 2006 10:37:44 -0800


On Mar 5, 2006, at 10:16, Philippe Robin wrote:

Hello,

Is there a way to list all the selectors a given object can respond to?

I've used a class method like this:

+ (void)printSelectorList:(id)anObject;
{
    int k = 0;
    void *iterator = 0;
    struct objc_method_list *mlist;

    NSString *className = [[anObject class] description];

while( mlist = class_nextMethodList( [anObject class], &iterator ) ){
for(k=0; k<mlist->method_count; k++){
NSLog(@"%@ implements %s", className, mlist->method_list [k].method_name);
}
}
}


Depending on how early you call it, the list may vary.

--
Adam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Listing all selectors for an object (From: Philippe Robin <email@hidden>)

  • Prev by Date: Listing all selectors for an object
  • Next by Date: Re: Cut, Copy, & Paste Question.
  • Previous by thread: Listing all selectors for an object
  • Next by thread: GDB: without symbol name?
  • Index(es):
    • Date
    • Thread