0

I am trying to show addresses of a certain list of Latitude/Longitude using MKReverseGeocoder i get values of some Lat/Long right,while for some i get {PBHTTPStatusCode=503} /SourceCache/ProtocolBuffer/ProtocolBuffer-92/Runtime/PBRequester.m:687 server returned

I have a dynamic list of lat/long just like foursquare app.

Some of my code: Where pData contains the list of lat/long

-(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);
}

Can any help me out in this!

Thnx a lot

Kara
  • 6,115
  • 16
  • 50
  • 57
iPhoneDev
  • 303
  • 1
  • 2
  • 10

1 Answers1

0

Perhaps you are making too many queries too quickly and the geocoding server is returning an error. It's recommended that you don't make more than about 1 request per second. Check in the delegate method

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

to see what the error was.

nevan king
  • 112,709
  • 45
  • 203
  • 241