我正在尝试在 UITextField 上设置 ontouch 侦听器,但它根本不起作用这是我的代码:
class SettingsVC: BaseVC {
@IBOutlet weak var languageField: SkyFloatingLabelTextField!
@IBOutlet weak var btnburgerMenu: UIButton!
@IBOutlet weak var headerLbl: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
languageField.addTarget(self, action: "myTargetFunction:", for: UIControlEvents.touchDown)
}
func myTargetFunction(textField: SkyFloatingLabelTextField) {
print("test")
}
}
这是我的错误
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IFO.SettingsVC myTargetFunction:]: unrecognized selector sent to instance 0x7fac8b61ff30'
异常的原因是什么?