title: How Can I Display the Map At Will?
body: <p>I’ve borrowed the Whereami code found in The Big Nerd Ranch iOS book and used it in the app I’m writing. My app determines the user's location and displays it in a map in the app delegate, just like Whereami app in the book does. The <code>UIWindow</code> is made visible and displays the map correctly. From this point on, the code is my own.</p>
  
  <p>My app allocates a <code>UINavigationController</code>, sets the root view controller, and proceeds to allow the user to view other view controllers and perform other methods after navigating to them. </p>
  
  <p>At some point, a view controller contains a button labeled “MAP” that, when pressed, should display the map showing the user’s current location. </p>
  
  <p>How can I get the app to display the <code>UIWindow</code> that is in the AppDelegate.m? I assume the app delegate is continuing to determine the user’s location, and I want the user to have the ability to display the map at will.</p>
  
  <p>My current code allocates a <code>MapViewController</code> when the “MAP” button is pressed, but I can’t figure out how to get the <code>UIWindow</code> which is in the AppDelegate.m to display. </p>
  
  <p>I’m thinking I should be able to do it by having a pointer to the <code>UIWindow</code> in the <code>MapViewController</code>. Is this the right approach? Do I need anything else? I'm using Xcode 4.0.2, Snow Leopard, and testing on an iOS 4 device. I'm new at this, and I don't want to get confused by upgrading to Lion, a higher Xcode, or iOS 5 yet.</p>