【发布时间】:2012-11-17 17:15:09
【问题描述】:
我想通过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;
}];
但是返回的 placemarks 是 nil 并且错误描述是 kCLErrorDomain error =8
【问题讨论】:
-
newLocation 的值是多少?
-
新位置是
[[CLLocation alloc] initWithLatitude:32.392917 longitude:119.416108] -
Apple Maps 那里有道路数据吗?