Dismiss two modal view controllers
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.