これが私のコードと、reverseGeocodeLocation を呼び出そうとする完全なコンテキストです。
CLLocationCoordinate2D touchMapCoordinate =
[self.mapView convertPoint:touchPoint toCoordinateFromView:self.mapView];
CLLocation *destination = [[CLLocation alloc] initWithLatitude:touchMapCoordinate.latitude longitude:touchMapCoordinate.longitude];
__block CLGeocoder *destinationPin = [[CLGeocoder alloc] init];
__block NSString *destinationPinName;
[destinationPin reverseGeocodeLocation:destination completionHandler:^(NSArray *placemarks, NSError *error) {
if (error){
NSLog(@"Geocode failed with error: %@", error);
return;
}
if(placemarks && placemarks.count > 0)
{
CLPlacemark *topResult = [placemarks objectAtIndex:0];
NSString *addressTxt = [NSString stringWithFormat:@"%@ %@,%@ %@",
[topResult subThoroughfare],[topResult thoroughfare],
[topResult locality], [topResult administrativeArea]];
destinationPinName = [[NSString alloc] initWithString:addressTxt];
}
}];
annotation = [[MQAnnotation alloc] initWithTitle:destinationPinName andCoordinate:touchMapCoordinate];
関数のエントリ ポイント、関数内の両方の if ブロック内、および注釈を割り当てる関数の後にブレークポイントを設定しました。reverseGeocodeLocation ブロックに到達すると、destinationPin には有効な値がありますが、プログラムは関数呼び出しの後に設定されたブレーク ポイントに直接ジャンプし続けます。何が起こっているのでしょうか??