title: Referencing AppDelegate Methods - iphone
body: <p>I have an AppDelegate which has 3 views. I add all three</p>
  
  <pre><code>[window addSubview:gameViewController.view];
  [window addSubview:viewSettings.view];
  [window addSubview:viewController.view];
  [window makeKeyAndVisible];
  </code></pre>
  
  <p>In the app delegate, i have some methodes for swapping views by calling</p>
  
  <pre><code>[window bringSubviewToFront:gameViewController.view]; 
  </code></pre>
  
  <p>When i am inside viewController, I use  </p>
  
  <pre><code>pinkAppDelegate *appDelegate=  (pinkAppDelegate *)[[UIApplication sharedApplication] delegate];
  
  [appDelegate switchToSettings];
  </code></pre>
  
  <p>to switch my subviews...so far so good.</p>
  
  <p>BUT, when I'm in my viewSetting UIViewController, and do the same appDelegate call, it chocks, like it doesn't understand how to call the appDelegate method.</p>
  
  <p>I've got all my views hooked in my mainwindow xib, but can't figure out why i can't traverse the methods in the main appdelegate</p>