self.locationManager = [[[CLLocationManager alloc] init]autorelease];
self.locationManager.pausesLocationUpdatesAutomatically=NO;
[self.locationManager setDelegate:self];
if([[[UIDevice currentDevice ]systemVersion] floatValue]>=8.0)
{
if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[self.locationManager requestWhenInUseAuthorization];
}
}
[self.locationManager startUpdatingLocation];
The code never calls didUpdate locations method instead did fail with error called immediately. Error Description: The operation couldn’t be completed. (kCLErrorDomain error 0.) But some times didUpdate locations getting called (1 out of 20 times), Tried resetting Network and locations settings but still not working.
Thank you