dormitkon dormitkon - 1 year ago 49
Objective-C Question

MKReverseGeocoder: where is location string stored?

I found this tutorial:

and implemented this code:

if (reverseGeocoder != nil)
// release the existing reverse geocoder to stop it running
[reverseGeocoder release];

// use whatever lat / long values or CLLocationCoordinate2D you like here.
CLLocationCoordinate2D locationToLookup = {52.0,0};
MKReverseGeocoder *reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:locationToLookup];
reverseGeocoder.delegate = self;
[reverseGeocoder start];

The question is, when I started reverseGeocoding, where is location string stored?
I have coordinate and I give them to reverseCeocoder to find me address, but how to get this address in some string for example?

Answer Source

Just read the documentation for MKReverseGeocoder:

The reverse geocoder returns information through its associated delegate object, which is an object that conforms to the MKReverseGeocoderDelegate protocol.

So you have to implement these two methods in your delegate:

– reverseGeocoder:didFindPlacemark:
– reverseGeocoder:didFailWithError:

and the geocoder will call them when it has information for you.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download