切换视图退出并尝试再次进入失败
我的应用程序有问题。在选项卡控制器中,我有一个登录视图,可以在其中输入网站。如果登录数据正确,视图将切换到另一个视图。工作正常。
现在我的问题是,当我切换选项卡并再次输入登录视图标签并尝试再次登录时,视图不会加载。
这里有什么问题吗?当视图卸载或其他东西时我应该关闭modalviewcontroller吗???
感谢您的帮助, Brush51
编辑1: 嗨,罗宾,在我的登录视图中有一个按钮,它通过以下代码调用网络视图:
ShopWebViewController *shopWVC = [[ShopWebViewController alloc] initWithNibName:@"ShopWebViewController" bundle:nil];
shopWVC = [[ShopWebViewController alloc] initWithNibName:@"ShopWebViewController" bundle:nil];
shopWVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[logView presentModalViewController:shopWVC animated:YES];
现在,当我退出此日志视图所在的选项卡栏项目并再次输入它时,会出现第一个视图,并且登录/presentmodalviewcontroller 不再工作。 因此,我认为我可能不得不解雇modalviewcontroller,但不知道这是否正确。
i have a problem in my app. in an tabbarcontroller i have a login view where i can enter a website. if the login data is correct the view switches to another view. works fine.
now my problem is, when i switch the tab and enter the login view tag again and try to login again, the view does not load.
Whats here the problem? should i dismissmodalviewcontroller when the view is unload or something else???
thanks for help,
brush51
EDIT1:
hi robin, in my login view is an button which calls a webview whit this code:
ShopWebViewController *shopWVC = [[ShopWebViewController alloc] initWithNibName:@"ShopWebViewController" bundle:nil];
shopWVC = [[ShopWebViewController alloc] initWithNibName:@"ShopWebViewController" bundle:nil];
shopWVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[logView presentModalViewController:shopWVC animated:YES];
And now when i exit the tabbar item where this logview is and enter it again, then the first view appears and the login/presentmodalviewcontroller doesnt work again.
cause of this i think that i may have to dismissmodalviewcontroller but dont know if this is right or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您点击登录按钮时:
然后在刚刚以模态方式呈现的视图控制器中,代码中的某个位置(也许登录成功时?)您需要使用以下命令将其关闭
When you hit the login button:
Then in your view controller that has just been presented modally, somewhere in your code (perhaps when login is successful?) you need to dismiss it with