title: Xcode error: xpected to have a root view controller at the end of application launch
body: <p>I'am getting this error ( Applications are expected to have a root view controller at the end of application launch ) and i'am not sure why? I was expecting something like the token is: 38c866dd bb323b39 ffa73487 5e157ee5 a85e0b7c e90d56e9 fe145bcc 6c2c594b. But no :(</p>
  
  <p>Really hope someone has a solution for this issue. Thank you, for using you time on this.</p>
  
  <p>The code is as follow.</p>
  
  <pre><code>#import "AppDelegate.h"
  #import "ViewController.h"
  
  @implementation AppDelegate
  
  @synthesize window;
  @synthesize viewController;
  
   - (void)applicationDidFinishLaunching:(UIApplication *)application {    
  
  [window addSubview:viewController.view];
  //[self.window setRootViewController:viewController];
  
  [window makeKeyAndVisible];
  
  NSLog(@"Registering for push notifications...");    
  [[UIApplication sharedApplication] 
   registerForRemoteNotificationTypes:
   (UIRemoteNotificationTypeAlert | 
    UIRemoteNotificationTypeBadge | 
    UIRemoteNotificationTypeSound)];
  
  }
  
  - (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { 
  
  NSString *str = [NSString 
                   stringWithFormat:@"Device Token=%@",deviceToken];
  NSLog(str);
  
  }
  
  - (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:     (NSError *)err { 
  
  NSString *str = [NSString stringWithFormat: @"Error: %@", err];
  NSLog(str);    
  
  }
  
  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
  
  for (id key in userInfo) {
      NSLog(@"key: %@, value: %@", key, [userInfo objectForKey:key]);
   }    
  
   }
  
  
  - (void)dealloc {
  [viewController release];
  [window release];
  [super dealloc];
   }
  
  @end
  </code></pre>