Reference: StackOverflow
iOS navigation controller Uinavigationcontroller, controller a jumps (push) to B, B jumps (push) to C, but C back (pop) enters a. The code in the B jump (push) to C is written as follows:
Uinavigationcontroller *navcontroller = [[Self.navigationcontroller retain] autorelease]; [Navcontroller Popviewcontrolleranimated:no]; Viewcontrollerc *_viewcontroller = [[[[Viewcontrollerc alloc] init] autorelease]; [Navcontroller Pushviewcontroller:_viewcontroller Animated:yes];
Code parsing
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 navigation controller Uinavigationcontroller, controller a jumps (push) to B, B jumps (push) to C, but C back (pop) enters a