使用带有三个或更多参数的performSelector?
各种performSelector:...
方法最多可以处理传递给指定选择器的两个参数。如果我需要传递三个或更多参数怎么办?
The various performSelector:...
methods can handle a maximum of two arguments passed to the specified selector. What can I do if I need to pass three or more arguments?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要为此使用 NSInitation 类。请查看这个问题,了解有关使用它们的更多详细信息。
You need to use NSInvocation class for that. Check this SO question for more details on using them.
我不喜欢 NSInitation 方式,它需要太多代码。
如果您想立即执行选择器,这里有一个简单而干净的方法:
I dislike the
NSInvocation
way, it needs too much code.If you’d like perform the selector immediately, here is an simple and clean way: