CLLocation *location =[[CLLocation alloc]initWithLatitude:latitude longitude:longitude];
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) {
NSLog(@"Finding address");
if (error) {
NSLog(@"Error %@", error.description);
} else {
NSLog(@"%@",placemarks[0]);
}
}]; }
enum CLError : Int {
case LocationUnknown
case Denied
case Network
case HeadingFailure
case RegionMonitoringDenied
case RegionMonitoringFailure
case RegionMonitoringSetupDelayed
case RegionMonitoringResponseDelayed
case GeocodeFoundNoResult
case GeocodeFoundPartialResult
case GeocodeCanceled
case DeferredFailed
case DeferredNotUpdatingLocation
case DeferredAccuracyTooLow
case DeferredDistanceFiltered
case DeferredCanceled
case RangingUnavailable
case RangingFailure
}
Here i got one Error in IOS 9 Device (in simulator it's working good ;-))
ERROR during geocode: Error Domain=kCLErrorDomain Code=2 "The operation couldn’t be completed. (kCLErrorDomain error 2.)"