如何在执行 popToRootViewController 后将视图控制器推送到导航堆栈上
仅在将堆栈弹出到 rootviewcontroller 后,我才尝试将新的视图控制器推送到导航堆栈上。
//Select the tab I want to go to
self.tabBarController.selectedIndex = FEEDPAGE_INDEX;
//Retrieve the navcon in the feed page
UINavigationController *navcon = (UINavigationController*)[self.tabBarController.viewControllers objectAtIndex:FEEDTAB_INDEX];
//Pop to root view controller here
[navcon popToRootViewControllerAnimated:YES];
//Push a new root view controller onto stack
QuestionAnswerViewController *x = [[QuestionAnswerViewController alloc]init];
[navcon pushViewController:x animated:YES];
推送不起作用,即没有显示新页面。似乎是 popToRootViewController 导致这种情况发生(不确定)。关于如何弹出然后推送新页面有什么建议吗?
I am trying to push a new view controller onto a navigation stack only after I pop the stack to rootviewcontroller
//Select the tab I want to go to
self.tabBarController.selectedIndex = FEEDPAGE_INDEX;
//Retrieve the navcon in the feed page
UINavigationController *navcon = (UINavigationController*)[self.tabBarController.viewControllers objectAtIndex:FEEDTAB_INDEX];
//Pop to root view controller here
[navcon popToRootViewControllerAnimated:YES];
//Push a new root view controller onto stack
QuestionAnswerViewController *x = [[QuestionAnswerViewController alloc]init];
[navcon pushViewController:x animated:YES];
The push didn't work i.e. no new page was displayed. It seemed that the popToRootViewController causes this to happen (not sure exactly). Any advise on how I can pop and then push a new page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)