dormitkon
dormitkon

Reputation: 2526

MKReverseGeocoder: where is location string stored?

I found this tutorial:

http://evilrockhopper.com/2010/01/iphone-development-reverse-geocoding/

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?

Upvotes: 0

Views: 415

Answers (1)

Ole Begemann
Ole Begemann

Reputation: 135568

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.

Upvotes: 2

Related Questions