繁体   English   中英

崩溃:_finishDecodingLayoutGuideConnections:]无法识别的选择器已发送到实例

[英]crashing: _finishDecodingLayoutGuideConnections:] unrecognized selector sent to instance

我正在使用X-code 9 beta Swift 4,可以运行和构建,但会收到以下错误,并且仅加载白屏:***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[myapp.logInVC _finishDecodingLayoutGuideConnections:]:无法识别的选择器已发送到实例0x10251ead0'

不确定_finishDecodingLayoutGuideConnections是什么? 我检查了所有选择器,但没有发现问题。 这是使用Firebase的登录屏幕,我希望如果登录成功,它将加载View Controller。 任何帮助将非常感激!

class logInVC:UIViewController {

@IBOutlet weak var signInSelector: UISegmentedControl!
@IBOutlet weak var signInLabel: UILabel!
@IBOutlet weak var emailTextField: UITextField!
@IBOutlet weak var passwordTextField: UITextField!

var isSignIn:Bool = true

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}
@IBAction func signInSelectorChanged(_ sender: UISegmentedControl) {

    switch signInSelector.selectedSegmentIndex
    {
    case 0:
        signInLabel.text = "sign in";
    case 1:
        signInLabel.text = "create account";
    default:
        break
    }
}



@IBAction func signInButtonTapped(_ sender: UIButton) {
    if isSignIn {
        //validation
        if let email = emailTextField.text, let pass = passwordTextField.text
        {
            //sign in with Firebase
            Auth.auth().signIn(withEmail: email, password: pass) { (user, error) in
                // make sure user isn't nil
                if user != nil {
                    //user is found, go to AR experience
                    self.performSegue(withIdentifier: "goToHome" , sender: self)
                }
                else {
                    //error, check error and show message

                }
            }
        }
        else {
            //register with Firebase
            Auth.auth().createUser(withEmail: emailTextField.text!, password: passwordTextField.text!) { (user, error) in
                // make sure user isn't nil
                if user != nil {
                    //user is found, go to AR experience
                    self.performSegue(withIdentifier: "goToHome" , sender: self)
                }
                else {
                    //error, check error, and show message
                }
            }

检查您的IBOutlets和IBAction是否正确连接。 如果您的XiB和Class文件未正确设置,则会发生此错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM