tags:

views:

49

answers:

1

Is there any way to replace PopToRootViewController by PopViewController?

I have six views ,2 nd view is pushed by 1st and ,and so,on............... If i'm on sixth view and there is 1 button is over there and on click of that button [self.navigationController PopToRootViewController:YES]; It will go back to me to the 1st view but i want to do it with popviewcontroller method only. It must pop 6th to 5,5th to 4,4th to 3,3rd to 2nd and ultimatally 2nd to 1 on click of button threough popviewcontroller

A: 

Here u need to maintain an array for each view that is pushed and when you pop from view u can load a view from array by kust passing its index and remove that object from array as soon as soon as its pop from the array

mrugen