title: iOS: Window object is nil
body: <p>I had an app delegate and I needed to add custom tab bar controller to override UITabbarController. I have created Window user interface, reference Window to Appdelegate's Window object. made File's owner to UIApplication, added NSObject and changed identity class to my delegate, added UITabbarController and changed identity class to my custom tabbar controller. Now I see very unusual that Window object in didFinishLaunchingWithOptions is coming nil so I don't see anything on the screen. Also my custom tabbar controller object is nil! Following is my new Window structure and main.m. Could anyone please tell me where am I doing wrong? Thanks.</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      @autoreleasepool {
          return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
      }
  }
  
  
  Appdelegate.h
  
  #import &lt;UIKit/UIKit.h&gt;
  #import "CustomTabBarController.h"
  
  @interface AppDelegate : UIResponder &lt;UIApplicationDelegate, UITabBarControllerDelegate&gt;
  
  @property (strong, nonatomic) IBOutlet UIWindow *window;
  
  @property (strong, nonatomic) IBOutlet CustomTabBarController *tabBarController;
  
  @end
  
  Appdelegate.m
  
  #import "AppDelegate.h"
  
  @implementation AppDelegate
  
  @synthesize window = _window;
  @synthesize tabBarController = _tabBarController;
  
  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      if(_window == nil) // This is true for self.Window as well!
          NSLog(@"nil");
      if(_tabBarController.view == nil)
          NSLog(@"nil");
      [self.window addSubview:self.tabBarController.view];
      [self.window makeKeyAndVisible];
      return YES;
  }  
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/fJOTc.png" alt="enter image description here"> </p>