如何枚举类的方法
有没有办法枚举一个类的方法, 例如,我有一个如下定义的类:
@class Foo : NSObject
-(void)doStuff1;
-(void)doStuff2;
@end
我想知道是否有任何方法可以让我使用枚举方法访问方法“doStuff1”和“doStuff2”,甚至在我知道该类有两个方法之前。
我知道方法 [foo PerformSelector:@selector(doSutff1)]
但这不是我想要的。
请任何人告诉我怎么走,非常感谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您使用运行时库...
检查Apple文档 这里
You use the runtime library...
Check the Apple docs here