tags:

views:

25

answers:

1

Hi, I have 5 UIs/Views and these are if in normal way,one after another..1->2->3->4->5..But when i reach page 5, I would like to reopen page 3 back.I know i can use PushViewController but this one is as creating one more view and I don't want to do like that.As my views are already in view stack i m wondering anything like i can choose the definite view from just now opened stacks.For PopViewController i can open very recent page (for my case it will be page 4).But i would like to jump over to page 3.How can I do that?Any suggestions please.

+1  A: 

There are basically three ways you can go back in the UINavigationController's stack:

  1. One controller at a time, using popViewControllerAnimated:.
  2. All the way back to the bottom of the stack, using popToRootViewControllerAnimated:.
  3. Back to a specific controller in the stack, using popToViewController:animated:.

That last should do what you're trying to do. The one down side is that you need to pass that method a pointer to controller you want to back track to. So you'll need to figure out some way to make that happen (pass a pointer down through the stack, walk back the chain of parentViewController values, keep a pointer at your application delegate, etc.).

Sixten Otto
Thanks.I will try as you said.I really appreciate ur answer.
Saw Sandar