Pregunta

I've been googling around a little bit, but i can't seem to find code snippets that can give me the zip code of the current location from an iOS device without any use of API's and such. Most answers regarding the topic are using deprecated classes. And if this is possible, will it only get zip codes from the US or other countries in Europe aswell?

Any help would be greatly appreciated. :)

¿Fue útil?

Solución

Since MKReverseGeocoder is deprecated in iOS 5, now it's CLGeocoder. You could create a CLGeocoder object and, with a previously-created CLLocation object with the coordinates, use the following method:

- (void)reverseGeocodeLocation:(CLLocation *)location completionHandler:(CLGeocodeCompletionHandler)completionHandler

Here is an example and Document.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top