首页 > 代码库 > ios导航控制器UINavigationController,控制器a跳转(push)到b后,b跳转(push)到c,但c后退(pop)进入a
ios导航控制器UINavigationController,控制器a跳转(push)到b后,b跳转(push)到c,但c后退(pop)进入a
參考:StackOverflow
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。