I have a navigation controller which present one modal viewController. From inside this modal viewController I present another modal viewController. All I want is to get bac
In iOS 5 you need to do
[self.presentingViewController.presentingViewController dismissModalViewControllerAnimated:YES]
Edit: As of iOS 6 dismissModalViewControllerAnimated:
is deprecated.
You need to call
[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:^{ // Do something on completion}]
Problem solved :)
I tried
[self.parentViewController.parentViewController dismissModalViewControllerAnimated:YES];
and works.
Thanks.