Swift 2.3
我使用in创建了一个按钮的方法Xcode 8
。比方说
@IBAction func testAction(sender: UIButton) {
print("\(sender.tag)");
}
但是在Connections inspector
情节提要编辑器中它显示为testActionWithSender:
,我知道这不是正确的方法名称,但我对此没有任何问题,直到它崩溃
[TestProject.ViewController testActionWithSender:]:无法识别的选择器发送到实例 0x7ff3f3e050e0
点击按钮。
那么为什么方法名称会发生变化,Connections inspector
我该如何解决呢?