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.
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"];
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
Post a Comment