Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人可以告诉我
我使用这种方法“[aClass respondsToSelector:@selector(fun)]”来查找任何课程中是否有乐趣
但是当乐趣有三个参数时,我该如何处理呢?
谢谢
在选择器中,每个冒号 (:) 都是一个参数。对于方法- (id)funWithA:(id)a B:(id)b C:(id)c
- (id)funWithA:(id)a B:(id)b C:(id)c
[aClass respondsToSelector:@selector(funWithA:B:C:)];
如果参数之间没有文字- (id)fun:(id)a :(id)b :(id)c
- (id)fun:(id)a :(id)b :(id)c
[aClass respondsToSelector:@selector(fun:::)];