ios5 - iOS: How to programmatically navigate/jump to different scenes managed by Navigation Controller? -


i have series of views managed under navigation controller. there way programmatically (in ios5+) jump (push/pop) different views? instance, have

navigationcontroller->rootviewcontroller->detailviewcontroller1->detailviewcontroller2->detailviewcontroller3

how can i, say, jump rootviewcontroller detailviewcontroller3, , jump detailviewcontroller1?

thanks.

you can try this.

  1. get vcs storyboard. (you have set identifiers in storyboard)

    uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; uiviewcontroller *detailviewcontroller1 = [storyboard instantiateviewcontrollerwithidentifier:@"detailviewcontroller1identifier"]; uiviewcontroller *detailviewcontroller3 = [storyboard instantiateviewcontrollerwithidentifier:@"detailviewcontroller3identifier"]; 
  2. push vcs way need.

    [self.navigationcontroller pushviewcontroller:(detailviewcontroller1) animated:yes]; [self.navigationcontroller pushviewcontroller:(detailviewcontroller3) animated:yes]; 

now, when press "back" you'll see detailviewcontroller1.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -