UIButton addSelector有多个参数

时间:2012-01-17 08:33:41

标签: iphone uibutton

我有UIButton如下:

[btnMailAddress addTarget:self action:@selector(showMap:) forControlEvents:UIControlEventTouchDown];  

我的问题是,如何在 showMap 方法中发送多个参数?

2 个答案:

答案 0 :(得分:1)

谷歌搜索selector multiple parameters提供了许多相关答案。

第一个结果 - Calling selectors with multiple arguments

答案 1 :(得分:0)

你做不到。如果您需要调用具有多个参数的方法,则需要首先通过“IBAction”类型方法重定向它(即, - (void)action:(id)sender)。