Neelesh
Neelesh

Reputation: 3693

retrieve address using MKReverseGeocoder

I am trying to retrieve the user address using MKReverseGeocoder. It works fine, but I am not getting the address in the proper format.

code:

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
    NSLog(@"Geocoder completed");
    NSLog(@"%@",[placemark.addressDictionary objectForKey:@"FormattedAddressLines"]);
}

Output:

(
    "Almungev\U00e4gen 33",
    "Tempe, AZ 85281",
    USA
)

Why am i getting those strange characters in street name ? How can i change it to a readable format?

Help would be appreciated.

Upvotes: 0

Views: 680

Answers (1)

Narayanan Ramamoorthy
Narayanan Ramamoorthy

Reputation: 826

In

  - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark

   {
   Nsstring*subLocalityStr= placemark.subLocality;
   Nsstring*subAdministrativeAreaStr= placemark.subAdministrativeArea;

   }

similarly you can get using dot notation which will give list of available methods from that you can select what you want ..

Upvotes: 1

Related Questions