Appdelegate sigabrt没有出现任何东西!在主故事板上

时间:2019-03-18 19:23:09

标签: swift xcode appdelegate

我正在制作新闻提要,当我尝试添加帖子时,它会显示此警报[SIGABRT],而不是去下一个viewController撰写帖子,这是图片,知道吗?

image of the mainstoryboard

second

这些是断点和异常的一部分。

breakpointimage

class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FirebaseApp.configure()

        let authListener = Auth.auth().addStateDidChangeListener { auth, user in
            let storyboard = UIStoryboard(name: "Main", bundle: nil )

            if user != nil {
                UserService.observeUserProfile(user!.uid) { UserProfile in
                    UserService.currentUserProfile = UserProfile
                }

                //
                let controller = storyboard.instantiateViewController(withIdentifier: "MainTabBarController") as! UITabBarController

                self.window?.rootViewController = controller
                self.window?.makeKeyAndVisible()
            } else {
                UserService.currentUserProfile = nil

                let controller = storyboard.instantiateViewController(withIdentifier: "MenuViewController") as! ViewController

                self.window?.rootViewController = controller
                self.window?.makeKeyAndVisible()
            }
        }

        return true
    }
}

0 个答案:

没有答案