Best practice is to handle rotation events in a single UIViewController
, rather than using two separate ones. I'm not familiar with interface builder, but programmatically you can override -(void)viewWillLayoutSubviews;
and lay out your view appropriately based on self.interfaceOrientation
. I recommend you do it that way.
However, in answer to your question:
try changing
[[self presentingViewController] dismissViewControllerAnimated:NO completion:nil];
to
[self dismissViewControllerAnimated:NO completion:nil];
This may fix the 2nd problem as well, because the old landscape view controller not being properly dismissed.