title: IOS-didFailWithError: Error Domain=kCLErrorDomain Code=0. (kCLErrorDomain error 0.)”
body: <p>I try to get the longitude &amp; latitude of the user current location, my code is simply this :</p>
  
  <pre><code>- (void)viewDidLoad {
      self.locationManager=[[CLLocationManager alloc]init];
      [locationManager setDelegate:self];
      [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
      [locationManager startUpdatingLocation];
  }
  
  -(void)locationManager:(CLLocationManager *)manager
  didUpdateToLocation:(CLLocation *)newLocation
  fromLocation:(CLLocation *)oldLocation
  {
      float latitude=newLocation.coordinate.latitude;
      float longitude=newLocation.coordinate.longitude;
      NSLog(@"%f",latitude);
      NSLog(@"%f",longitude);
      [locationManager stopUpdatingLocation];
  
  }
  - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error 
  {
      NSLog(@"didFailWithError: %@", error);
  }
  </code></pre>
  
  <p>I got always this error from the didFailWithError method :</p>
  
  <pre><code>didFailWithError: Error Domain=kCLErrorDomain Code=0 "The operation couldn’t be completed. (kCLErrorDomain error 0.)" 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8RtZq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8RtZq.png" alt="enter image description here"></a></p>