title: Dismiss presented view controller, after the presenting view controller has been released
body: <p>I am working on some old code that I didn't write, and it's really not architected well...</p>
  
  <p>The situation is that a view controller presents a custom view controller modally, however every 30 seconds the presenting view controller is recreated.</p>
  
  <p>The issue here is that if the modal is on screen when this happens, then any effort to dismiss it results in odd behaviour (such as a white screen).</p>
  
  <p>I have tried calling <code>[self.presentedViewController dismissViewControllerAnimated];</code> on the newly recreated controller, but <code>presentedViewController</code> is nil as you would expect.</p>
  
  <p>I have also tried keeping a weak reference to the modal view controller, then when the presenting VC is reloaded, setting this value to that of the old VC. This has allowed me to call <code>self.customModalVC dismissViewControllerAnimated];</code> but this is causing the aforementioned white screen, perhaps because it's presenting VC is no longer in the stack?</p>
  
  <p>Any and all suggestions appreciated.</p>