title: Rotating iPhone 6 Plus results in gray detail view controller?
body: <p>I am experiencing an odd issue with split view controllers, and I've been able to recreate the issue very easily in a brand new app. If you rotate the iPhone 6 Plus to landscape the master and detail view controller become visible on screen, but if you then rotate back to portrait and switch tabs then rotate to landscape, the detail view controller will be completely gray as if nothing is there. This is logged to console: <code>&lt;Error&gt;: CGImageCreate: invalid image size: 0x0</code> I would like to know if you know the cause or what can be done to fix this bug.</p>
  
  <p><strong>The setup</strong> is a <code>UITabBarController</code> with three tabs, each tab is the default <code>UISplitViewController</code> dragged out via Interface Builder. Subclass <code>UISplitViewController</code> and change the 3 split views to that class. Set the split view controller's delegate to self in <code>viewDidLoad</code>. Then return YES from <code>splitViewController:collapseSecondaryViewController:ontoPrimaryViewController:</code>. This sets it up so that the master remains visible after rotating back to portrait instead of the default details view controller.</p>
  
  <p><strong>To reproduce the bug:</strong> Launch app in portrait on iPhone 6 Plus, rotate to landscape, rotate back to portrait, tap the second or third tab, rotate to landscape<br>
  <strong>Bug:</strong> The detail view controller is completely gray<br>
  <strong>Expected:</strong> The detail view controller should appear like it normally does if you launch the app, tap a different tab, then rotate to landscape</p>
  
  <p><strong>Additional info:</strong> Once this occurs, if you rotate back to portrait and then go back to a different tab it will also show a gray detail controller upon rotation to landscape. The app must be force quit and relaunched to see those split views in landscape.</p>
  
  <p>Now I noticed if you open the app and the first tab is displayed, if you rotate the iPhone 6 Plus to landscape, it actually initializes every single master and detail view controller in the tab bar controller (5 additional view controllers) - it stops at breakpoints set in <code>viewDidLoad</code> if you subclass those controllers. I expected it to only initialize the detail view controller for the split view controller that's displayed on screen. I'm wondering if this is expected behavior? I believe it could be linked to this bug. </p>
  
  <p><strong>My question is, is this gray screen a bug in iOS, or is there a problem with this setup, or is there something that can be done to prevent this from occurring?</strong></p>
  
  <p>How it should appear:<br>
  <img src="https://i.stack.imgur.com/kCTsb.png" alt="Screenshot of expected appearance"></p>
  
  <p>How it appears when following the above steps:<br>
  <img src="https://i.stack.imgur.com/QgSVt.png" alt="Screenshot of gray detail view controller bug"></p>