ios - Load a stack of View Controllers from AppDelegate -


when re-start app want pop correct question of assessment (the last 1 answered):

uistoryboard *storyboard =[ uistoryboard storyboardwithname:@"assessment" bundle:nil]; uinavigationcontroller *vc = [storyboard instantiateviewcontrollerwithidentifier : @"imagequestionviewcontroller"]; uinavigationcontroller *questionsnavigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:vc]; imagequestionviewcontroller *viewcontroller =[questionsnavigationcontroller.viewcontrollers objectatindex:0]; [viewcontroller setquestionnumber:0]; questionsnavigationcontroller.navigationbar.hidden = yes; self.window.rootviewcontroller = questionsnavigationcontroller; 

so set question number creates correct view, however, previous button meant pop last instance of view controller (question number 1 - say):

- (ibaction)pressback:(id)sender {     [self.navigationcontroller popviewcontrolleranimated:yes]; } 

however, when created appdelegate doesn't create other view controllers underneath it, hence popviewcontroller doesn't work. don't want instantiate view controllers don't want change code.

is there way create whole stack of view controllers essentially.

thanks!


Comments