你好我的故事板上有两个视图控制器。一个是 LoginViewController ,另一个是 HomeViewController 。 LoginController是initialviewcontroller。在loginController中,我正在检查用户是否已登录的viewWillAppear
方法。如果用户已登录,我将用户重定向到HomeViewController,如果没有,那么我没有正在进行anthing。问题是我在控制台上显示HomesViewController时出现此错误。它成功显示了屏幕,但不知道如何删除此错误
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated);
self.navigationController?.setNavigationBarHidden(true, animated: true)
let prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults()
let isLoggedIn:Int = prefs.integerForKey("ISLOGGEDIN") as Int
if (isLoggedIn != 1) {
splashView.hidden=true
}else{
let nav : UINavigationController = UINavigationController(rootViewController: self.storyboard!.instantiateViewControllerWithIdentifier("HomeViewController") as UIViewController)
self.navigationController?.presentViewController(nav, animated: false, completion: nil)
}
}