Changing the master view in Split View does not update the popover in portrait

怎甘沉沦 提交于 2019-12-11 07:20:11

问题


I've got an app using the a split view controller and I'm setting the master and detail view controllers in the App delegate. However, depending on user interaction (them touching a UIButton), I am changing the master view, by accessing the viewcontrollers array of the split view controller.

The problem is, when I do this, and then change the orientation of the iPad to portrait, and access the master view via the popover, it is showing the previous master view, and not the new one I had set. This is confusing, since, in landscape orientation, the correct master view (the new one that has been set) is being shown. Not sure why the popover in portrait is not updating to the new master view set in the viewcontrollers property of the split view.

Would appreciate any ideas on how to rectify this. Thanks.


回答1:


I managed to solve the problem. Just for the record and in case anyone else may have this problem in the future - the solution I eventually found was to use a navigation controller for the master view controller, and then push/pop viewcontrollers as I needed.. and I no longer have issues with the popover in portrait orientation! Just be careful not to push the same controller twice, otherwise the app will crash - when done with the controller, pop it.



来源:https://stackoverflow.com/questions/8610132/changing-the-master-view-in-split-view-does-not-update-the-popover-in-portrait

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!