0

I am trying to use the MKReverseGeoCoder API to get a city name based of a coordinate. For some reason the delegate never gets called; any ideas why? Here is the code:

- (void)startReverseLookup
{
  [reverseCoordinateInfo initWithCoordinate:self.currentlocation.coordinate];
  [reverseCoordinateInfo setDelegate:self];
  [reverseCoordinateInfo  start];
  NSLog(@"Reverse Geocode started");
}

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
     {
      NSLog(@"RC - ERROR !!!");
      }

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark    *)placemark
 {
     NSLog(@"RC lookup finished !! - Locality is:%@",placemark.locality);
 }  

I am declaring the protocol on the .h file and then I call startReverseLookup. I see the first NSLog, but after that nothing happens—it just stays there forever and the delegate never gets called for either method. Any suggestions?

yuji
  • 16,695
  • 4
  • 63
  • 64
jelipito
  • 171
  • 2
  • 2
  • 12

1 Answers1

0

change the following method -

- (void)startReverseLookup
{
    reverseCoordinateInfo = [[MKReverseGeocoder alloc] initWithCoordinate:self.currentlocation.coordinate];
    [reverseCoordinateInfo setDelegate:self];
    [reverseCoordinateInfo  start];
    NSLog(@"Reverse Geocode started");
} 
Ash Furrow
  • 12,391
  • 3
  • 57
  • 92
Abhijeet Barge
  • 562
  • 5
  • 21