Using iOS I Have 15 ViewControllers now I want to pop from one ViewController to another View Controller.
I am using this code:
SecondViewController *Sec
First:
SecondViewController *Sec=[SecondViewController alloc]init];
[self.navigationController popViewController:Sec animated:YES];
You can’t do this because you allocate a new Sec
view controller that’s not in a navigation controller.
Consider using this:
You are in 9 view controller
for (int i= 0 ; i < [[self.navigationController viewControllers]count] ; i++) {
if ( [[[self.navigationController viewControllers] objectAtIndex:i] isKindOfClass:[FifiViewControllerClassname class]]) {
[self.navigationController popToViewController:[array objectAtIndex:i] animated:YES];
}
}