ios - Master view controller disappears after tapping an item and quickly changing orientation from portrait to landscape -
xcode 4.5
application ipad device.
for ipad master view controller application, master view controller disappears after tapping item , changing orientation portrait landscape mode.
i used default template master-template application ipad. in portrait mode (ipad) tapped "+" button on master controller , added multiple items around 10. after tapped 1 of highlighted item in master controller (refer screen shot) changed orientation portrait landscape. in landscape mode master controller disappears , blank (black) screen appears.
i analysed further , found issue in following line of code
[self.masterpopovercontroller dismisspopoveranimated:yes];
in detailviewcontroller.m
- (void)setdetailitem:(id)newdetailitem { if (_detailitem != newdetailitem) { _detailitem = newdetailitem; // update view. [self configureview]; } if (self.masterpopovercontroller != nil) { [self.masterpopovercontroller dismisspopoveranimated:yes]; } }
if pass no [self.masterpopovercontroller dismisspopoveranimated:no];
works fine.
how solve issue?
thank you
in case, checkmark in ib: use autolayout
when unchecked that, rotated well.
hope helps!