迅速致命的错误

时间:2016-12-02 07:06:38

标签: ios swift

当我点击退出按钮时,我想回到mainviewcontroller,但它给了我:

  

致命错误:在解包可选值时意外发现nil

navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Logout", style: .plain, target: self, action: #selector(logOut))


 func logOut(){

    let mainViewController = MainViewController()
    present(mainViewController, animated: true, completion: nil)
}

0 个答案:

没有答案