我试图通过提供地址字符串来查找纬度和经度。对于这两个值,我得到 0.000 和 0.000。
我正在使用 MapKit、iOS 7、XCode 5
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressString:@"Fairfax, VA" completionHandler:^(NSArray* placemarks, NSError* error){
for (CLPlacemark* aPlacemark in placemarks)
{
CLLocationCoordinate2D coordinate;
coordinate.longitude = aPlacemark.location.coordinate.longitude;
coordinate.latitude = aPlacemark.location.coordinate.latitude;
// updatedCoordinates is a property in my class and I am setting it's value
// here and using it in bunch of other places.
self.updatedCoordinates = coordinate;
}
}];