简体   繁体   English

快速不平衡呼叫以开始/结束外观转换<UINavigationController: 0x7fd61043fce0>

[英]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.

相关问题 (2022) 出现错误:开始/结束外观转换的不平衡调用<uinavigationcontroller: 0x7fd050035000></uinavigationcontroller:> - (2022) Getting error: Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7fd050035000> 呼叫开始/结束状态转换的不平衡呼叫<UINavigationController: *****> - Unbalanced calls to begin/end appearance transitions for <UINavigationController: *****> Swift Unbalanced 调用开始/结束外观过渡 - Swift Unbalanced calls to begin/end appearance transitions for 不平衡的调用以开始/结束外观转换(我相信这与UINavigationController相关) - Unbalanced calls to begin/end appearance transitions for (I believe this is UINavigationController related) UINavigationController:使用SWRevealViewController错误:调用不平衡以开始/结束外观转换 - UINavigationController: using SWRevealViewController error:Unbalanced calls to begin/end appearance transitions iOS 7 UINavigationController非平衡调用开始/结束外观转换 - iOS 7 UINavigationController Unbalanced calls to begin/end appearance transitions for 开始/结束外观转换的不平衡呼叫<UITabBarController: 0x197870> - Unbalanced calls to begin/end appearance transitions for <UITabBarController: 0x197870> 呼叫开始/结束状态转换的不平衡呼叫<UISplitViewController: 0x133630> - Unbalanced calls to begin/end appearance transitions for <UISplitViewController: 0x133630> 对QLRemotePreviewContentController的开始/结束外观转换的不平衡调用 - Unbalanced calls to begin/end appearance transitions for QLRemotePreviewContentController CKPresentationControllerRootViewController的开始/结束外观转换的不平衡调用 - Unbalanced calls to begin/end appearance transitions for CKPresentationControllerRootViewController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM