title: IOS 8 CLLocationManager Issue (Authorization Not Working)
body: <pre><code>#import "MyLocationViewController.h"
  #define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
  
  @interface MyLocationViewController ()
  
  @end
  
  @implementation MyLocationViewController
  
  {
      CLLocationManager *locationManager;
  }
  
  - (void)requestAlwaysAuthorization
  {
      [locationManager requestAlwaysAuthorization];
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      // Do any additional setup after loading the view, typically from a nib.
      self.mapView.showsUserLocation = YES;
      self.mapView.delegate = self;
      locationManager = [[CLLocationManager alloc] init];
  
  }
  
  - (IBAction)unwindToMap:(UIStoryboardSegue *)segue
  {
  
  }
  
  - (IBAction)getCurrentLocation:(id)sender {
      locationManager.delegate = self;
      locationManager.desiredAccuracy = kCLLocationAccuracyBest;
      [locationManager startUpdatingLocation];
  }
  
  - (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
  {
      MKCoordinateRegion mapRegion;
      mapRegion.center = mapView.userLocation.coordinate;
      mapRegion.span.latitudeDelta = 0.001;
      mapRegion.span.longitudeDelta = 0.001;
  
  
  
  
      CLLocationCoordinate2D location = userLocation.coordinate;
      float lat = location.latitude;
      float lng = location.longitude;
  
      NSDictionary *locationDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
                                          [NSNumber numberWithFloat:lat] , @"Latitude",
                                          [NSNumber numberWithFloat:lng], @"Longitude", nil];
  
      NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
                                  locationDictionary, @"Location_A",
                                  nil];
      NSError *error;
      NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dictionary options:NSJSONWritingPrettyPrinted error:&amp;error];
  
      NSString *str = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
      NSLog(@"%@",str);
  
  
  
      if (mapView.userLocation != nil)
      {
          _longitudeLabel.text = [NSString stringWithFormat:@"%.8f", mapView.userLocation.coordinate.longitude];
          _latitudeLabel.text = [NSString stringWithFormat:@"%.8f", mapView.userLocation.coordinate.latitude];
      }
  
      [mapView setRegion:mapRegion animated: YES];
  
  }
  
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>
  
  <p>This is my code.</p>
  
  <p><strong>Now, I understand that I needed to edit my info.plist file (which I did) with a NSLocationAlwaysUsageDescription key, and I added a string for the description.</strong></p>
  
  <p>However, I'm having issues implementing the authorization portion, as the error still reads as such:</p>
  
  <pre><code>Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.
  </code></pre>
  
  <p>I've read the Apple IOS 8 docs for the CLLocationManager, but somehow my code will not work.</p>
  
  <p>Can someone help me so that the above error message goes away by looking at where in my code I need to modify so that it works?</p>
  
  <p>Thanks!</p>