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 en开发者_开发问答umerate methods, even before I know the class has two methods.
I know the method [foo performSelector:@selector(doSutff1)]
but this is not I want.
You use the runtime library...
class_copyMethodList
Check the Apple docs here
精彩评论