title: Error "Application windows are expected to have a root view controller" (iOS)
body: <p>I've created a blank iPhone app project and would like to show a full-screen advertisement during app launch.</p>
  
  <p>I tried to install the ad by following this guideline: <a href="https://github.com/mopub/mopub-ios-sdk/wiki/Interstitial-Integration-For-iOS" rel="nofollow noreferrer">https://github.com/mopub/mopub-ios-sdk/wiki/Interstitial-Integration-For-iOS</a></p>
  
  <p>That's what I've done finally:</p>
  
  <p><img src="https://i.stack.imgur.com/7H3lV.png" alt="In ViewController.h"></p>
  
  <p><img src="https://i.stack.imgur.com/vUk2k.png" alt="In ViewController.m"></p>
  
  <p>Actually all codes are just copied from the previous link.</p>
  
  <p>However, an error shows when app runs:</p>
  
  <blockquote>
    <p><strong>Application windows are expected to have a root view controller at the end of application launch</strong></p>
  </blockquote>
  
  <p>I think this error may probably related to the loadView method, because if I remove the loadView method, the error disappeared.</p>
  
  <p>In fact, this error seems common as it can be easily searched on the internet, but I don't know how loadView is related to it, and how can it be solved in my case.</p>
  
  <p>Any solutions? Thanks a lot.</p>