提示:Couldn't find a navigation controller for segue "...", push segues can only be used when the source controller is managed by an instance of UINavigationController"
提示:Couldn't find a navigation controller for segue "...", push segues can only be used when the source controller is managed by an instance of UINavigationController"
前提是你的A控制器必须是在导航控制器栈中。也就是说A控制器要么是导航控制器的根控制器rootController ,要么就是导航控制器中viewcontrollers中的一员。 看提示你的A好像不是UINavigationController吧。如果不是在storyboard中,将当前控制器embed in uinavigationcontroller 或者使用代码
UINavigationController *navA = [[UINavigationController alloc] initWithRootViewController:a];[/quote]
A ,B两个 vc 都是在 storyboard中,这下似乎就没有办法了吧,是否能够通过拖navigation item来实现呢?
[/quote]
看来要手把手了。 按我的操作来,在storyboard上点击A控制器,选择菜单上的“Editor” ,在展开的下拉菜单中选择“Embed In” 后面有子菜单展开,点击“Navigation Controller ”
这样在storyboard中就将你的A控制器embed in navigationcontroller 中了,其实就是将A设置为了导航控制器的根控制器rootController
提示:Couldn't find a navigation controller for segue "...", push segues can only be used when the source controller is managed by an instance of UINavigationController"
前提是你的A控制器必须是在导航控制器栈中。也就是说A控制器要么是导航控制器的根控制器rootController ,要么就是导航控制器中viewcontrollers中的一员。 看提示你的A好像不是UINavigationController吧。如果不是在storyboard中,将当前控制器embed in uinavigationcontroller 或者使用代码
UINavigationController *navA = [[UINavigationController alloc] initWithRootViewController:a];[/quote]
A ,B两个 vc 都是在 storyboard中,这下似乎就没有办法了吧,是否能够通过拖navigation item来实现呢?
由A控制器 push到B控制器, 在B上会自动出现一个 < Back 回退按钮。如果这个回退按钮不符合你的要求,你可以在B 上 用leftBarButtonItem 来模拟,但需要自己实现回退的方法
提示:Couldn't find a navigation controller for segue "...", push segues can only be used when the source controller is managed by an instance of UINavigationController"
由A控制器 push到B控制器, 在B上会自动出现一个 < Back 回退按钮。如果这个回退按钮不符合你的要求,你可以在B 上 用leftBarButtonItem 来模拟,但需要自己实现回退的方法
提示:Couldn't find a navigation controller for segue "...", push segues can only be used when the source controller is managed by an instance of UINavigationController"