我不知道爲什麼我的代碼不工作這,我跟着這個https://www.youtube.com/watch?v=tt2xfrRk3Ck
它始終保持拋出錯誤線程1:。信號SIGABRT我是新來的迅速和iOS開發雨燕」主題1:信號SIGABRT在PresentViewController
錯誤拋出:
self.presentViewController(homeViewController, animated: true, completion: nil)
代碼:
FIRAuth.auth()?.addAuthStateDidChangeListener { auth, user in
if let user = user {
let mainStoryboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let homeViewController: UIViewController = mainStoryboard.instantiateViewControllerWithIdentifier("HomeView")
self.presentViewController(homeViewController, animated: true, completion: nil)
} else {
self.loginButton.center = self.view!.center
self.loginButton.readPermissions = ["public_profile", "email", "user_friends"]
self.loginButton.delegate = self
self.view!.addSubview(self.loginButton)
self.loginButton.hidden = false
}
}
不工作,但我發現這個錯誤消息 '終止應用程序由於未捕獲的異常「NSInternalInconsistencyException」,原因:「 - [的UITableViewController的loadView]從故事板‘主’標識符‘HomeView’實例化視圖控制器,但沒有得到一個UITableView.''。這是什麼意思? –
我拖動一個UITableViewController並使用該來代替UIViewController,但錯誤消失了,但我想知道爲什麼我不能使用UIViewController?也當我在可可觸摸創建一個新的文件沒有UIViewController選項。現在,我有一個問題,兩者之間有什麼區別。 –