UINavigation控制器根视图更改 [英] UINavigation Controller Root View Change

查看:124
本文介绍了UINavigation控制器根视图更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了Storyboard的一个小问题。我有一个 UINavigationController 而不是与MainView的关系 RootViewController (这个按钮的所有按钮都通向其余的我的应用)。但是,我尝试更改 RootViewController ,以便我可以启用持久登录而不是UIWebview登录。当我将新的Logon Form ViewController 作为Root时,我的MainView上的按钮就会停止工作。

I recently encountered a small problem with Storyboards. I have a UINavigationController than has a relationship with the MainView RootViewController(This one has all the buttons leading to the rest of my app). However, I tried to change the RootViewController so that I could enable persistent login rather than a UIWebview Login. When I made the new Logon Form ViewController as the Root, the buttons on my MainView simply stop working.

I还将 UINavigationController 设置为初始视图控制器。
关于这里必须做什么的任何想法?

I also have set the UINavigationController as the initial View Controller. Any ideas on what has to be done here?

我知道我可以在故事板中简单地使用登录屏幕并以编程方式调用它,将其设置为在布尔条件(loginDidSucceed)上前进。但是,我很困惑为什么在StoryBoard中会发生这种行为。

I do know that I can simply have the logon screen in the storyboard and call it programmatically, set it to advance on a boolean condition(loginDidSucceed). However, I am confused on why this behavior happens in StoryBoard.

解决方案来自:使用StoryBoard呈现启动/登录ViewController

感谢您的帮助和努力!

推荐答案

我认为这里的主要问题是你的butttons的目标是旧的视图控制器实例;当它超出范围时,它们的目标不再存在。

I think the principal problem here is that the target of your butttons is the old view controller instance; when it goes out of scope their target no longer exists.

这篇关于UINavigation控制器根视图更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆