0

MKReverseGeocoder を使用して緯度/経度の特定のリストのアドレスを表示しようとしています:687 サーバーが返されました

foursquare アプリと同じように、緯​​度/経度の動的リストがあります。

私のコードの一部: pData には緯度/経度のリストが含まれています

-(void)network:(WNetwork*)network didFinishLoadingWithRequest:(NSInteger)pReq data:(NSMutableDictionary*)pData{


 for (NSDictionary *dic in pData) {

                CLLocationCoordinate2D coord;
                coord.longitude = [[dic objectForKey:@"long"]doubleValue];
                coord.latitude = [[dic objectForKey:@"Lat"]doubleValue];

                MKReverseGeocoder *geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:coord];
                [geocoder setDelegate:self];
                [geocoder start];
            }

}


- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
    NSLog(@"The geocoder has returned: %@", [placemark addressDictionary]);
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{


    NSLog(@"error people: %@", error);
}

これで私を助けることができますか!

たくさんありがとう

4

1 に答える 1

0

あまりにも多くのクエリをすばやく作成しすぎて、ジオコーディング サーバーがエラーを返している可能性があります。1 秒あたり約 1 件を超えるリクエストを行わないことをお勧めします。デリゲート メソッドをチェックインする

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error

エラーの内容を確認します。

于 2012-03-20T17:31:38.103 に答える