TabBarController 应用程序上的presentModalViewController - 解雇ModalViewController后出现空白屏幕
我在我的应用程序中使用 tabbarcontroller 并且还想使用登录视图。 我有一个 LoginController 来处理登录过程。 我以模态方式呈现登录视图。
[self.tabbarcontroller presentModalViewController:loginView animated:NO];
在其他方面,我将其忽略(登录成功后):
[self dismissModalViewControllerAnimated:YES];
关闭后,我只有一个空白屏幕。这是我的 MainWindow.xib 中的空白窗口,我已经用测试标签检查了它。
对此感到烦恼。不知道如何解决这个问题。
i am using a tabbarcontroller in my app and also want to use a loginview.
I have an LoginController which handles the loginprocedure.
I am presenting the loginView modally.
[self.tabbarcontroller presentModalViewController:loginView animated:NO];
And on other point i am dismissing it(after login is successfull):
[self dismissModalViewControllerAnimated:YES];
After dismiss i have just a blank screen. Thats the blank window in my MainWindow.xib, i have checked it with a testlabel.
Throubles with that. No ideas how to solve this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两件事:
self.tabbarcontroller 不应该实例化模式视图。它应该是选项卡控制器控制的初始视图控制器。在该视图控制器的初始化中,您检查登录会话并显示登录 VC。
确保您正在忽略在呈现它的方法中创建的模态 VC。您应该为您的 Login VC 有一个委托方法(类似于 loginFinished),该方法在呈现它的 VC 中进行处理。
Two things:
The self.tabbarcontroller should not be instantiating the modal view. It should be the initial view controller that the tabbar controller controls. In the initialization of that view controller, you check for a login session and present the login VC.
Make sure you are dismissing that modal VC you created in the method that presented it. You should have a delegate method for your Login VC (something like loginFinished) that is handled in the VC that presented it.