为什么PKReveal rightViewController获取nil?

时间:2016-04-25 13:57:38

标签: ios swift

我在我的应用程序中使用了PKReveal,第一次我的右侧菜单打开但第二次变为零。请告诉我什么是错误。 我打开菜单的代码是:

 class  func displaySlideMenu(viewController:UIViewController)
{

    if viewController.navigationController?.revealController.focusedController() == viewController.navigationController?.revealController.rightViewController
    {

        APP_DELEGATE.navigationController?.revealController.showViewController(viewController.navigationController?.revealController.frontViewController)

    }else {

        print(viewController.navigationController?.revealController.rightViewController)

        APP_DELEGATE.navigationController?.revealController.showViewController(viewController.navigationController?.revealController.rightViewController)
    }

}

设置显示控制器代码是:

let frontPageViewController = FrontPageViewController(nibName:"FrontPageViewController",bundle: nil)
    APP_DELEGATE.navigationController = UINavigationController(rootViewController: frontPageViewController)
    let rightMenuViewController = RightMenuViewController(nibName:"RightMenuViewController",bundle: nil)
    APP_DELEGATE.revealController = PKRevealController(frontViewController: APP_DELEGATE.navigationController, rightViewController: rightMenuViewController)

    APP_DELEGATE.window?.rootViewController = APP_DELEGATE.revealController

我的菜单第一次打开然后如果我关闭并尝试再次打开我的视图控制器正在打印nil。

0 个答案:

没有答案