0

Is there any way to enumerate methods of one class, for example, I have one class defined like below:

@class Foo : NSObject
    -(void)doStuff1;
    -(void)doStuff2;
@end

And I was wondering if there is any way let me access the method "doStuff1" and "doStuff2" with enumerate methods, even before I know the class has two methods.

I know the method [foo performSelector:@selector(doSutff1)] but this is not I want.
Pls any guy tell me the way, thx so much.

ThomasW
  • 16,981
  • 4
  • 79
  • 106
  • 3
    possible duplicate of [List selectors for obj-c object](http://stackoverflow.com/questions/330030/list-selectors-for-obj-c-object) –  Jun 09 '11 at 09:21

1 Answers1

1

You use the runtime library...

class_copyMethodList

Check the Apple docs here

Simon Lee
  • 22,304
  • 4
  • 41
  • 45