我想通过 获取位置,CLLocationCoordinate2D
我使用了以下代码
//newLocation is a CLLocationCoordinate2D object
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:newLocation completionHandler:
^(NSArray *placemarks, NSError *error){
CLPlacemark *placemark = [placemarks objectAtIndex:0];
self.locationInput.text =placemark.subLocality;
self.locationInput.text =placemark.ISOcountryCode;
}];
但返回的地标为 nil 且错误描述为 kCLErrorDomain error =8