[英]UINavigation Controller Root View Change
I recently encountered a small problem with Storyboards. 我最近遇到了Storyboard的一个小问题。 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). 我有一个
UINavigationController
不是与MainView RootViewController
的关系(这个按钮的所有按钮都通向我的应用程序的其余部分)。 However, I tried to change the RootViewController
so that I could enable persistent login rather than a UIWebview Login. 但是,我尝试更改
RootViewController
以便我可以启用持久登录而不是UIWebview登录。 When I made the new Logon Form ViewController
as the Root, the buttons on my MainView simply stop working. 当我将新的Logon Form
ViewController
作为Root时,MainView上的按钮就会停止工作。
I also have set the UINavigationController
as the initial View Controller. 我还将
UINavigationController
设置为初始View Controller。 Any ideas on what has to be done here? 关于在这里要做什么的任何想法?
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). 我知道我可以在故事板中简单地使用登录屏幕并以编程方式调用它,将其设置为在布尔条件(loginDidSucceed)上前进。 However, I am confused on why this behavior happens in StoryBoard.
但是,我很困惑为什么在StoryBoard中会发生这种行为。
Solution Referred from: Present Splash/Login ViewController With StoryBoard 解决方案参考: 使用StoryBoard呈现Splash / Login ViewController
Thanks for the Help and Effort! 感谢您的帮助和努力!
I think the principal problem here is that the target of your butttons is the old view controller instance; 我认为这里的主要问题是你的butttons的目标是旧的视图控制器实例; when it goes out of scope their target no longer exists.
当它超出范围时,它们的目标不再存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.