title: MKMapView Zooming In On User's Location Once But Not The Second Time in Tab-Bar App (iOS)
body: <p>I have an MKMapView as part of a Navigation Controller in a Tab Bar based app.</p>
  
  <p>I click a UIButton on the first View Controller and it pushes to the second View Controller which contains the MKMapView. When the Map View loads, it zooms in on the user's location using:</p>
  
  <pre><code>- (void)mapView:(MKMapView *)theMapView didUpdateUserLocation:(MKUserLocation *)userLocation
  {
      if ( !initialLocation )
      {
          self.initialLocation = userLocation.location;
  
          MKCoordinateRegion region;
          region.center = theMapView.userLocation.coordinate;
          region.span = MKCoordinateSpanMake(2.0, 2.0);
          region = [theMapView regionThatFits:region];
          [theMapView setRegion:region animated:YES];
      }
  }
  </code></pre>
  
  <p>When I hit the back button on the Navigation Controller above the MapView and then click back to the map, it no longer zooms in on the user's current location, but just has the full zoom out default:</p>
  
  <p><a href="https://i.stack.imgur.com/0f5Sq.png" rel="nofollow noreferrer">Here's a picture of the view the second time.</a></p>
  
  <p>I figure it would work correctly if I could somehow call the didUpdateUserLocation in the viewDidAppear method but I'm not sure how to pull this off since the didUpdateUserLocation is a delegate method.</p>
  
  <p>Is that the right approach or is there a different approach I should take to do this? Thanks!</p>
  
  <p>P.S. <a href="https://stackoverflow.com/questions/6213763/mapview-not-zooming-on-second-try-using-didupdateuserlocation" title="question">I've seen this question but it's slightly different with it's use of a modal view controller</a></p>