title: CLLocationManager does not send location to the didUpdateLocations method
body: <p>I am working on an <code>iOS 6.1 iPhone app</code> with <code>ARC</code> enabled which will be using a <code>CLLocationManager</code> to track the devices position. </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have a <code>DestinationViewController</code> which implements the <code>CLLocationManagerDelegate</code>. It creates the <code>CLLocationManager</code> and does the setup. I have imported the <code>CoreLocation framework</code> to my project.</p>
  
  <p>I have tried to debug a lot and can see that the <code>CLLocationManager</code> is created and no errors are present. But the problem is that the <code>[CLLocationManager authorizationStatus]</code> is <code>kCLAuthorizationStatusNotDetermined</code>
  both before <code>[self.locationManager startUpdatingLocation];</code> and also <em>after</em>.
  So there is no prompt about asking permission to use location services for this app. Because of that this method is never fired.</p>
  
  <pre><code>- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:  
  (NSArray *)locations
  </code></pre>
  
  <p>I have also tried to search the web for hours to look for similar examples but with no luck. Code from DestinationViewController is posted below.</p>
  
  <p>Interface</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;CoreLocation/CoreLocation.h&gt;
  
  @interface DestinationViewController : UIViewController &lt;CLLocationManagerDelegate&gt;
  </code></pre>
  
  <p>Implementation</p>
  
  <pre><code>#import "DestinationViewController.h"
  
  @interface DestinationViewController ()
  @property (strong, nonatomic) CLLocationManager *locationManager;
  @end
  
  
  @implementation DestinationViewController
  
  // Initializer
  - (CLLocationManager *)locationManager
  {
      if (!_locationManager) {
          _locationManager = [[CLLocationManager alloc] init];
      }
      return _locationManager;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
      [self startLocation];
  }
  
  
  - (void)startLocation
  {
      self.locationManager.delegate = self;
      self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
      self.locationManager.distanceFilter = 1;
  
      NSString *error;
      if (![CLLocationManager locationServicesEnabled]) {
          error = @"Error message";
      }
  
      CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
      if (status == kCLAuthorizationStatusRestricted ||
          status == kCLAuthorizationStatusDenied ||) {
          error = @"Error message";
      }
  
      if (error) {
          NSLog(error);
      }
      else
      {
  
          status = [CLLocationManager authorizationStatus];
  
      self.locationManager.pausesLocationUpdatesAutomatically = NO;
  
          [self.locationManager startUpdatingLocation];
  
          status = [CLLocationManager authorizationStatus];
  
          NSLog(@"CLLocationManager is %@", self.locationManager);
          NSLog(@"Location is %@", self.locationManager.location);
  
          [self updateUI];
      }
  }
  
  
  - (void)locationManager:(CLLocationManager *)manager
       didUpdateLocations:(NSArray *)locations
  {
      CLLocation *recentLocation = [locations lastObject];
      NSLog(@"Found location");
  }
  
  - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
  {
      NSLog(@"didFailWithError");
  }
  
  - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
  {
      NSLog(@"Change in authorization status");
  }
  </code></pre>