[英]Push ViewController in NavigationController from side menu
I'm using a UINavigationController and I have a side menu in it. 我正在使用UINavigationController,并且其中有一个侧面菜单。 The problem is that when I want to push a UIViewController in the NavigationController from the side view it doesn't work.
问题是,当我想从侧面视图在NavigationController中推送UIViewController时,它不起作用。 To do it, is use that code:
为此,请使用以下代码:
[self.slidingViewController resetTopView];
CDRecentChats* recentchats = [[CDRecentChats alloc]init];
UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"conversation"];
[recentchats.navigationController pushViewController:controller animated:YES];
As you can see, I first close de side menu and then call the NavigationController to push a new ViewController. 如您所见,我首先关闭右侧菜单,然后调用NavigationController推送新的ViewController。 Using that code, the only thing that happens is that the menu is closed, but the NavigationController doesnnt push any ViewController.
使用该代码,唯一发生的事情是菜单被关闭,但是NavigationController不会推送任何ViewController。 what can I do?
我能做什么?
popToViewController
means to go back to one that has already been made part of the navigation controller's stack. popToViewController
意味着返回到已经成为导航控制器堆栈一部分的一个。 If you're trying to show a new one, use pushViewController
. 如果您要显示一个新的,请使用
pushViewController
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.