Im trying to dismiss a ModaViewController called C
, back to A
. The ModalViewController is presented in B
. Therefore the Navigation flow is A->B - (present ModalView) -> C. I am able to dismiss the ModalViewController
back to B, but I am unable to pop back to A in the completion bracket. This is the code I have tried:
[self dismissViewControllerAnimated:YES completion:^{
[self.navigationController popToViewController:[[self.navigationController viewControllers] objectAtIndex:0] animated:YES];
}];
The ModalViewController is dismissed but does not pop back to A. I call this block of code in an IBAction
.
Any advice?
On a second note, when I dismiss the ModalViewController
all my UIPickers
in Controller B
are empty/ deallocated. I am using ARC as well.