Joker Bean..
Joker Bean..

Reputation: 33

How to enumerate methods of a class

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.

Upvotes: 0

Views: 172

Answers (1)

Simon Lee
Simon Lee

Reputation: 22334

You use the runtime library...

class_copyMethodList

Check the Apple docs here

Upvotes: 1

Related Questions