Ios SIGABRT因为FBSDK

Ios SIGABRT因为FBSDK,ios,xcode,facebook,firebase,fbsdk,Ios,Xcode,Facebook,Firebase,Fbsdk,所以我注意到FBSDK在很大程度上影响了故事板,所以我会告诉你我想做什么,当我打开应用程序时,为什么它会显示SIGABRT 以下是我想要执行的操作: func switchStoryboard() { self.performSegue(withIdentifier: "LoginConnection", sender: self) } 这就是我希望它的执行方式: override func viewDidLoad() { super.viewDidLoad()

所以我注意到FBSDK在很大程度上影响了故事板,所以我会告诉你我想做什么,当我打开应用程序时,为什么它会显示SIGABRT

以下是我想要执行的操作:

func switchStoryboard() {

    self.performSegue(withIdentifier: "LoginConnection", sender: self)

}
这就是我希望它的执行方式:

override func viewDidLoad() {
    super.viewDidLoad()

    if FBSDKAccessToken.current() != nil {
        print("User is logged in")
    }
    else {
        self.switchStoryboard()
    }
问题应位于以下位置:

func loginButton(_ loginButton: FBSDKLoginButton!, didCompleteWith result: FBSDKLoginManagerLoginResult!, error: Error!) {
    if (error != nil){
        print(error)
        return
    }
    FBSDKGraphRequest(graphPath: "/me", parameters: ["fields": "id, name, email"]).start { (connection, result, err) in
        if (error != nil){
            print("Failed to get graph request", err)
            return
        }
        print(result)
    }
嗯,我不知道。我试着调试,似乎一切正常,但它让我很困惑,希望这里的人也有同样的错误,并能帮助我解决这个问题,非常感谢。

修复了:

if((FBSDKAccessToken.current()) != nil){
        FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id, name, email"]).start(completionHandler: { (connection, result, error) -> Void in
            if (error == nil){
                print(result)
            }
            self.switchStoryboard()
            print("user is not signed in")
        })
    }
问题是,
self.switchStoryboard()
的功能和两个
print
的功能都不工作