我不断收到此错误:
Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit
即使我把自我放在代码中。请纠正我。
这是我的代码:
@IBAction func doneButton(_ sender: Any) {
let code = codeTextField.text
if code == "TEST" || code == "Test" || code == "test" {
var myAlert = UIAlertController(title:"Alert", message: "You are logging into The Test Zoo, right?", preferredStyle: UIAlertController.Style.alert)
let yesAction = UIAlertAction(title: "Yes", style: UIAlertAction.Style.default) {
UIAlertAction in
performSegue(withIdentifier: "welcomeButton", sender:self)
}
还有更多,但 yesAction 需要更正。
performSegue
是一个方法,您隐式调用它self
;显式版本是self.performSegue(...)
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)