When using Navigationviewcontroller for page jumps, you should use the Pushviewcontroller method to jump to the next page, so the next page is also in the Navigationviewcontroller container.
1. Skip to the next page:
Alonesetprizeviewcontroller *setprize = [[Alonesetprizeviewcontroller alloc] init]; // to jump page Alonesetprizeviewcontroller has a property dictionary1 is a nsmutabledictionary type of container [setprize.dictionary1 setobject:[self.txtpasswd text] forkey:alone_siteprize_pwd]; // use Pushviewcontroller to jump to the next page [Self.navigationcontroller pushviewcontroller:setprize animated:true];
2, from the current page to return to the previous page and pass the value of the past:
// This page already exists in Self.navigationController.viewControlle RS, and is the previous page of the current page alonesetsiteviewcontroller *SETPRIZEVC = [self.navigationController.viewControllers Objectatindex:self.navigationcontroller.viewcontrollers.count-2 ]; // initialize its properties setprizevc.dictionary = nil; // pass parameter past setprizevc.dictionary = [ Nsmutabledictionary DictionaryWithDictionary:self.dictionary1]; // [Self.navigationcontroller POPTOVIEWCONTROLLER:SETPRIZEVC animated:true ];
After you return to the previous page, the previous page is displayed after you receive the parameters and refresh. Note that this should be done in Viewdidappear and receive the passed values:
-(void) viewdidappear: (BOOL) animated{ // judge and receive the returned parameters }
3, return from the current page to the previous page (no value) method:
// return to previous interface -(ibaction) Backoff: (ID) sender{ [Self.navigationcontroller Popviewcontrolleranimated:true];}
Ios--navigationviewcontroller jump, return pass value