0

I have a button which moves to the user's location. I declare it in ViewControler.h and then added the following code into ViewController.m:

- (IBAction)userLocation:(id)sender {   
    [_mapView setCenterCoordinate:_mapView.userLocation.location.coordinate animated:YES];
}

This keeps leading me to the (0,0) coordinates. Is there something in the newer Xcode version that I need to add to make this work again?

  • can you log the value of `_mapView.userLocation.location.coordinate`? – A O May 28 '15 at 17:19
  • You should also make sure you actually have location services enabled. iOS 8 changed the way the permissions work for that. – bdrell May 28 '15 at 17:30

1 Answers1

0

Since iOS8 you have to set a usage description for location services: https://stackoverflow.com/a/24718342/4948826

Community
  • 1
  • 1
ronhippler
  • 106
  • 1
  • 6