I have an iPad SplitViewController application with the following features:
- master (left hand) view controller is hidden in both portrait and landscape by returning YES in the shouldHideViewController delegate method
- master view controller contains a tab bar controller
- I utilise a multiple master detail manager to manage swapping the detail view controller based upon the selection made by the user in the master tab bar
I have a problem that only occurs after a memory warning is received by the application. When the master view slides in (either via a swipe or tapping the left bar button) the view appears effectively empty i.e. it does not contain any table view, just the semi-transparent background where the table view should be. If I tap the other view in my tab bar it loads it's master view correctly. If I then tap back to the problem view it now appears correctly.
Originally I had another problem in that not only was the view empty but it was also sized for full screen. I was able to fix the size problem via the solution proposed in this SO question - it is noted in the solution that "Apparently when a memory warning is received, the view controller gets released, so when it presents itself again, it gets it's size from it's parent view, which is full screen. So you just have to reset the frame every time it gets loaded."
By putting break points in my code I can verify that when I first try to access the master view after a memory warning the ViewDidLoad event is called (this does not occur if there has not been a memory warning), however the ViewDidAppear & ViewWillAppear events are not called. So the app is aware that it needs to reload the master view after a memory warning, but for some reason it does not seem to show the master view.
I'm struggling to work out how to correctly make the view appear again after a memory warning. Or is there something I should be doing to prevent the master view from being unloaded when a memory warning is received?
UPDATE: I have also observed that if the master view is showing at the time of the memory warning then this problem does not occur.