mbuc91
mbuc91

Reputation: 1552

Presented views on iOS 6 disappear. How do I fix this?

I have two views that I present from a view controller: one for settings, one for a device log. When I run the app on an iPad and present the view, then rotate the device, the view disappears.

If I present the view (using a button) in portrait (either one) and rotate it, it disappears. If I then present the view again, it reappears, and then rotates correctly.

Why does this happen? What can I do to fix it?

Thanks for any responses.

UPDATE: This only occurs if I first present the view in portrait mode. If I present it in landscape mode first, it rotates just fine and doesn't disappear.

In my master view controller's viewDidLoad:

self.logViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"LogViewController"];
[self.logViewController setModalInPopover:YES];
[self.logViewController setModalPresentationStyle:UIModalPresentationFormSheet];
[self.logViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];

My method called when the Log button is pressed:

- (void)showInfoView:(id)sender
{
    [self presentViewController:self.logViewController animated:YES completion:NULL];
}

Upvotes: 0

Views: 192

Answers (1)

mbuc91
mbuc91

Reputation: 1552

I have realized what I was doing wrong. I was presenting the presented view controller from my Master view in a SplitViewController. By presenting it from the Detail view, the problem was solved.

Upvotes: 1

Related Questions