如何在选择器方法中发送两个参数? [英] How can I send two arguments in a selector method?

查看:92
本文介绍了如何在选择器方法中发送两个参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面,我如何在 togButton 方法中发送两个参数?我尝试了,但它没有工作。

In the following, how can I send two arguments in togButton method? I tried, but it did not work.

[button addTarget:self action:@selector(togButton:) 
             forControlEvents:UIControlEventTouchUpInside];


推荐答案

控制目标只接受其操作的一个参数:控制被操纵。没有办法做你想要的(操作系统不支持它)。

control targets only accept one argument for their actions: the control that's being manipulated. There's no way to do what you want (the OS just doesn't support it).

这篇关于如何在选择器方法中发送两个参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆