title: UIWindow not having any subviews
body: <p>I wanted to understand the view hierarchy in an iOS app so I made a Single View Application using XCode 4.6. It automatically creates an app delegate and a view controller. Here's the relevant part from the app delegate:</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
  (NSDictionary *)launchOptions
  {
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
      // Override point for customization after application launch.
      self.viewController = [[MBIViewController alloc] initWithNibName:@"MBIViewController" bundle:nil];
      self.window.rootViewController = self.viewController;
      [self.window makeKeyAndVisible];
      return YES;
  }
  </code></pre>
  
  <p>So, it initializes a window and then sets the window's root view controller. Since UIWindow is a UIView, and UIView has the subviews property, I expected that the root view controller's view will be a subview of my app's window. So I checked for it in this root view controller's method:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  
      UIWindow *currentWindow = [[[UIApplication sharedApplication] delegate] window];    
      NSLog(@"Subview count of current window: %d", currentWindow.subviews.count);
      NSLog(@"Superview of root view controller's view: %@", self.view.superview);
  }
  </code></pre>
  
  <p>Strangely enough the output was:</p>
  
  <pre><code>Subview count of current window: 0
  Superview of root view controller's view: (null)
  </code></pre>
  
  <p>I have assumed that the main window will be the topmost view in the view hierarchy and everything will be its subview. However, based on my little experiment it seems that there's this main window and the root view controller's view that's both sitting on the top of the view hierarchy, with them not having any subview/superview relationship! Can anyone explain why my root view controller's view is not a subview of the main window? Thanks</p>