views:

122

answers:

1

Hello all,

So I have a popover being presented from a barbutton. However I am having some rotation issues when a modal view is being displayed over it. The view inside the popover is not rotating properly. I have all of the delegates set to yes, so it should automatically handle this. This is only happening when that modal view is being displayed over it. Is it possible to dismiss the popover when the user selects an item from the table inside the popover? Thanks!


UPDATE: So I figured out how to dismiss the popover by keeping a reference via a delegate. This did not fix the rotation problems. Does anyone have any idea what may be causing this? Thanks

A: 

Modal View Controllers override the rotation capabilities of its parent View

Add the following function to your ModalViewController

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}
davydotcom
I have that. The modal view rotates fine. The problem is that if the iPad is rotated while the modal view is displayed, then the parent view does not rotate as well.
Geoff Baum
I just noticed that the view is always facing the bottom (home button) when the modal view is dismissed. That's why it is appearing sideways/upside down/ etc. Does that tell you anything else?
Geoff Baum
Why are you trying to render a Modal View within a popover Anyway. That may not be inline with iPad interface guidelines. I might suggest popping the modal view over the rootViewController of the entire application. This would probably resolve your issue all-together.
davydotcom
Yeah, that's what I decided to do. I did some research and that would not have flown anyways. Thanks for the help davy!
Geoff Baum