[英]Swift Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7fd61043fce0>
Good day, I'm new around here, hope this question isn't too silly. 美好的一天,我是这里的新手,希望这个问题不要太傻。
I got the warning Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7fd61043fce0>
during runtime. 我在运行时Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7fd61043fce0>
警告。 However, I cannot find anywhere in my code that has UINavigationController
, nor any other file in the project. 但是,我在代码中找不到UINavigationController
任何地方,也找不到项目中的任何其他文件。
import UIKit
class ViewController: UIViewController,PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate, FBLoginViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//self.navigationController?.navigationBarHidden = true
if(PFUser.currentUser() == nil){
var logInViewController = PFLogInViewController()
logInViewController.delegate = self
//customize logInViewController
logInViewController.fields = PFLogInFields.UsernameAndPassword | PFLogInFields.LogInButton | PFLogInFields.PasswordForgotten | PFLogInFields.Facebook | PFLogInFields.SignUpButton
logInViewController.facebookPermissions = ["public_profile", "email", "user_friends"]
logInViewController.logInView.logo = UIImageView(image: UIImage(named: "Logo"))
//create a signUpViewController instance
var signUpViewController = PFSignUpViewController()
signUpViewController.delegate = self
//add signUpViewController instance to logInViewController for signUp module.
logInViewController.signUpController = signUpViewController
self.parentViewController?.presentViewController(logInViewController, animated: true, completion: nil)
}else{
FBSession.activeSession().close()
}
}
Am I missing something that I should check? 我是否缺少应检查的内容?
I would move the presentation of the login to viewWillAppear from viewDidLoad. 我将登录的演示文稿从viewDidLoad移到viewWillAppear。 This will make sure everything is setup in the current controller before you show another. 这将确保在显示其他控制器之前,所有设置都已在当前控制器中设置。
Also present the login controller from self and not self.parentViewController. 还应显示来自self而不是self.parentViewController的登录控制器。 This could be where your error comes from. 这可能是您的错误来源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.