title: self.window.rootViewController = self.someController not working?
body: <p>I came across this post here (link below) and it states that you can replace:</p>
  
  <p><code>[window addSubview: someController.view];</code></p>
  
  <p>with:</p>
  
  <p><code>self.window.rootViewController = self.someController;</code></p>
  
  <p>My Base SDK for All Configurations is set to Latest iOS (currently set to iOS 4.2), however when I try to build the project I get this error: <code>Request for member, 'mainMapView' in something not a structure or union.</code></p>
  
  <p>Adding it with the commented out addSubview: works fine though.
  This is the code in question...</p>
  
  <pre><code>#import "MakeView2AppDelegate.h" 
  
   #import "MainMap.h" 
  
   @implementation MakeView2AppDelegate
  
   @synthesize window;
  
  
   - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
      // Override point for customization after application launch.
  
      MainMap *mainMapView = [[MainMap alloc] initWithNibName:nil bundle:nil];
  
      //[self.window addSubview:mainMapView.view];
  
      self.window.rootViewController = self.mainMapView;
  
      [self.window makeKeyAndVisible];
  
      return YES;
  }
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/5248460/self-window-rootviewcontroller-vs-window-addsubview">self.window.rootViewController vs window addSubview</a></p>