简体   繁体   English

UINavigation控制器根视图更改

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

相关问题 在UINavigation Controller的UITabBarController中获取视图控制器的currentViewController - Get currentViewController of View Controller in UITabBarController in UINavigation Controller 如何知道UINavigation控制器iPhoneSDK的当前视图 - How to know Present view of UINavigation controller iPhoneSDK 在uinavigation控制器中从下往上推视图 - pushing a view from bottom to top in uinavigation controller 如何改变UINavigation Controller Header的字体。 - How to change the font of UINavigation Controller Header.? 如何更改uinavigation控制器后退按钮动作 - how to change uinavigation controller back button action 更改在UInavigation Controller中添加的UIImage的背景图像 - Change background image of UIImage added in UInavigation Controller 如何将根视图更改为导航控制器? - How to change Root View to Navigation Controller? 如何克服使用情节提要的UINavigation Controller弹出视图控制器动画? - How to overcome UINavigation Controller pop view controller animation using storyboard? 如何从Tabbar控制器获取UINavigation控制器并推送特定视图 - How to get UINavigation controller from Tabbar controller and push a specific view 如何获取uinavigation bar后退按钮以返回到其他视图控制器 - How to get a uinavigation bar back button to return to anthother view controller
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM