-[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] error
This is my code, showing both the alert and the blue dot for the current position on the map: MapName.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import <CoreLocation/CoreLocation.h> @interface MapName : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate> @property (strong, nonatomic) IBOutlet MKMapView *MapName; @property (strong, nonatomic) CLLocationManager *locationManager; @end MapName.m - (void)viewDidLoad { [super viewDidLoad]; self.locationManager = [[CLLocationManager alloc]init]; self.locationManager.delegate = self; if ([self.locationManager respondsToSelector: