My rootviewcontroller in my iPad app presents a modal viewcontroller through [self presentModalViewController:... animated:YES]
(lets call it ViewControllerA).
At some point, ViewControllerA itself presents a MFMailComposeViewController
via [self presentModalViewController:... animated:YES]
.
In the delegate method mailComposeController:didFinishWithResult:error:
I want to dismiss BOTH of the controllers, the MFMailComposeViewController
AND ViewControllerA.
But no matter what i try ([self.parentViewController dismissModalViewControllerAnimated:YES]
, [self dismissModalViewControllerAnimated:YES]
, calling dismiss twice), ONLY the MFMailComposeViewController
is dismissed, but ViewControllerA stays visible.
I already found this post (http://stackoverflow.com/questions/3229755/dismissing-multiple-modal-view-controllers-at-once) and this post (http://stackoverflow.com/questions/3105855/how-to-move-to-first-viewcontroller-from-last-view-controller-among-multiple-vie), but the suggested solutions don't seem to work for me.
What am I doing wrong?