How to make viewViewAppear getting called in both Master and Detail view whenever they appear
My app has 5 screens which are controlled by a tabbar at bottom, and one of t开发者_运维技巧hem is a SplitView.
My Problem is:
- The master view is just cause viewWillAppear only one time at first rotation.
- The detail view is also just cause viewWillAppear only one time at first load.
While I would like viewViewAppear of both master and detail view are getting called each time this screen is opened, because there are 5 different screens, and user may leave this screen to view another, so I would like to know whenever master and details view appear to change layout or refresh data.
Please help me, thanks in advance!
It looks like you just anwsered your own question. I know its something you dont want to hear but apple's documentation says it must get the root view. Try to restructure your app a bit.
Link to documentation: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/iPadControllers/iPadControllers.html#//apple_ref/doc/uid/TP40007457-CH6-SW2
From the documentation:
A split view controller must always be the root of any interface you create. In other words, you must always install the view from aUISplitViewController object as the root view of your application’s window. The panes of your split-view interface may then contain navigation controllers, tab bar controllers, or any other type of view controller you need to implement your interface.
精彩评论