title: MKUserTrackingBarButtonItem Spinning After The App Is Disallowed To Use Current Location
body: <p>I have added an instance of MKUserTrackingBarButtonItem in a view controller's <code>viewDidLoad</code> as follows:</p>
  
  <pre><code>MKUserTrackingBarButtonItem *userTrackingButton = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self-&gt;mapView];
  NSMutableArray *toolbarItems = [[NSMutableArray alloc] initWithArray:[mapToolBar items]];
  [toolbarItems insertObject:userTrackingButton atIndex:0];
  [mapToolBar setItems:toolbarItems];
  </code></pre>
  
  <p>Location Services are turned on in Settings but not for the app. When the MKUserTrackingBarButtonItem button is tapped, the modal dialog asks the user whether to allow the app to use the current location. When "Don't Allow" is selected, MKUserTrackingBarButtonItem turns into a grey dashed spinning icon and the original compass icon is not restored.</p>
  
  <p>How do I go about restoring the state of the button as it is done in the Maps app?</p>
  
  <p>The desired behaviour is the same as what is in the Maps app.</p>
  
  <ol>
  <li>Ensure Location Services is turned on in Settings > Privacy > Location Services.</li>
  <li>Reset Location &amp; Privacy in Settings > General > Reset > Reset Location &amp; Privacy.</li>
  <li>Launch the Maps app.</li>
  <li>Tap the compass icon in the lower left corner.</li>
  <li>A dialog with the message ""Maps" Would Like to Use Your Current Location" appears. At this moment, the compass icon has turned into a grey dashed spinning icon.</li>
  <li>Choose "Don't Allow."</li>
  </ol>
  
  <p>The original compass icon is restored.</p>
  
  <p>I am testing this on the iPhone and not on the simulator. The above code works without a problem when Location Services are turned on and the app is allowed to use the current location.</p>