Ios 发送到实例tableview swift的选择器无法识别

Ios 发送到实例tableview swift的选择器无法识别,ios,swift,uitableview,uibutton,addtarget,Ios,Swift,Uitableview,Uibutton,Addtarget,在我的单元格中,我想在属于该单元格的按钮上添加一个函数 在我的cellFoRowAtIndexPath中,我添加了此代码 cell.acceptBtn.addTarget(self, action: "acceptRequest", forControlEvents: .TouchUpInside) 然后我有这个函数 func acceptRequest(sender: UIButton) { println("hello"); } 当我运行项目并单击该单元格上的按钮时,我得到一个

在我的
单元格中,我想在属于该单元格的按钮上添加一个函数

在我的
cellFoRowAtIndexPath
中,我添加了此代码

cell.acceptBtn.addTarget(self, action: "acceptRequest", forControlEvents: .TouchUpInside)
然后我有这个函数

func acceptRequest(sender: UIButton) {
    println("hello"); 
}
当我运行项目并单击该单元格上的按钮时,我得到一个

由于未捕获异常“NSInvalidArgumentException”而终止应用程序已将无法识别的选择器发送到实例

需要注意的是,我有另一个按钮,我使用了相同的方法,称为
declineRequest
,它工作得非常好

尝试以下操作:

cell.acceptBtn.addTarget(self, action: "acceptRequest:", forControlEvents: .TouchUpInside)

…注意它是
“acceptRequest:”
,而不是
“acceptRequest”
。后者意味着函数没有参数。

谢谢!它解决了我的问题。。。多么愚蠢的错误,但你刚刚救了我,我会在10分钟内接受答案,当它让我有可能重复的时候