ios导航控制器UINavigationController,控制器a跳转(push)到b后,b跳转(push)到c,但c后退(pop)进入a
Posted jzdwajue
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ios导航控制器UINavigationController,控制器a跳转(push)到b后,b跳转(push)到c,但c后退(pop)进入a相关的知识,希望对你有一定的参考价值。
ios导航控制器UINavigationController,控制器a跳转(push)到b后,b跳转(push)到c。但c后退(pop)进入a。
在b跳转(push)到c中代码书写例如以下:
UINavigationController *navController = [[self.navigationController retain] autorelease]; [navController popViewControllerAnimated:NO]; ViewControllerC *_viewController = [[[ViewControllerC alloc] init] autorelease]; [navController pushViewController:_viewController animated:YES];
代码解析
// self.navigationController(...,ViewControllerA、ViewControllerB) // navController(nil) UINavigationController *navController = [[self.navigationController retain] autorelease]; // self.navigationController(...,ViewControllerA、ViewControllerB) // navController(...,ViewControllerA、ViewControllerB) [navController popViewControllerAnimated:NO]; // self.navigationController(nil) // navController(...,ViewControllerA) ViewControllerC * _viewController = [[[ViewControllerC alloc] init] autorelease]; _viewController.messageEntity = [self.listArray objectAtIndex:indexPath.row]; // self.navigationController(nil) // navController(...,ViewControllerA) [navController pushViewController:_viewController animated:YES]; // self.navigationController(nil) // navController(...,ViewControllerA、ViewControllerC)
以上是关于ios导航控制器UINavigationController,控制器a跳转(push)到b后,b跳转(push)到c,但c后退(pop)进入a的主要内容,如果未能解决你的问题,请参考以下文章