1

当我在我的应用程序中多次按下按钮时,我的 AppDelegate 中出现错误。

Thread 1: signal SIGABRT

这是我的按钮代码。如果您有任何问题,请务必告诉我!

//import Firebase
//import SVProgressHUD
//import UIKit

@IBAction func logInPressed(_ sender: AnyObject) {
    if emailTextField.text != "" || passwordTextField.text != "" {

        FirebaseApp.configure()
        Auth.auth().signIn(withEmail: emailTextField.text!, password: passwordTextField.text!) {
            (user, error) in
            SVProgressHUD.show()
            if error != nil {
                print(error!)
                self.incorrect.isHidden = false
                SVProgressHUD.dismiss()
            } else {
                self.incorrect.isHidden = true
                SVProgressHUD.dismiss()

                self.performSegue(withIdentifier: "Segue9", sender: self)
            }
        }
    } else {
        incorrect.isHidden = false
    }
}
4

1 回答 1

1

FirebaseApp.configure() 需要在应用程序上调用:didFinishLaunchingWithOptions:来自AppDelegate的函数

崩溃可能正在发生,因为您调用了两次。

于 2018-02-20T17:08:59.947 回答