Question

I am developing a view based iPad application.It is a simple view based application in which the first loaded view contain one button .On click of this button i am creating a SplitViewController which contains two UINavigationControllers (one Master and other Detail)after this ,I am Removing current view(first view) and adding splitViewController's view to the window.The Master contains a button as bar button item (Home button)which does removing of SplitViewController's view and adding the first view to the window. If i launch my application in the landscape mode it works fine.But if i launch my application in portrait mode and click on Home button (on Master's navigation bar)it does not reaches to the first view and shows at the following error.This error also comes if i change my orientation from Portrait to Landscape,if i launched my application in Portrait mode.

2012-05-18 19:12:52.796 test_Project[3703:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:]: Popovers cannot be presented from a view which does not have a window.'
Was it helpful?

Solution 2

Finally I got my answer my self. In a view based application , when a popover is used, so when coming back from split view to view then first dismiss that popover(hide) and then remove the split view.

OTHER TIPS

To present a popover parent view should have valid frame. So try to check whether you are setting frame for parent view after adding a popover.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top