0
votes

Xcode 4.5

Application for iPad device.

For iPad Master View controller application, Master view controller disappears after tapping an item and quickly changing orientation from portrait to landscape mode.

I used Default template for Master-Template application for iPad. In portrait mode (iPad) I tapped "+" button on Master controller and added multiple items around 10. After that I tapped one of the highlighted item in the Master Controller (refer screen shot) then QUICKLY changed the orientation from portrait to landscape. In landscape mode Master Controller disappears and blank (black) screen appears.

I analysed it further and found issue in following line of code

[self.masterPopoverController dismissPopoverAnimated:YES];

in DetailViewController.m

- (void)setDetailItem:(id)newDetailItem
{
    if (_detailItem != newDetailItem) {
        _detailItem = newDetailItem;

        // Update the view.
        [self configureView];
    }

    if (self.masterPopoverController != nil) {
        [self.masterPopoverController dismissPopoverAnimated:YES];
    }        
}

If I pass NO to [self.masterPopoverController dismissPopoverAnimated:NO]; then everything works just fine.

How to solve this issue?

Thank you

Master-Detail application for iPad in portrait mode

Navigation/Master controller is gone

1
[self.masterPopoverController dismissPopoverAnimated:NO];. The Animated argument is no way related to your issue, it just says whether the action should happen in an animated way or not.Satheesh
I feel the animation delay cause some issue here.Rahul
Can you show me the code that you use in the rotation function?Satheesh
I am not using any code for rotation. I just used Default template for Master-Detail application for iPad then did the steps mentioned above.Rahul

1 Answers

0
votes

In my case, it was a checkmark in IB: Use Autolayout

When I unchecked that, everything rotated well.

Hope it helps!