BigLex BigLex - 1 year ago 92
iOS Question

Is there a way to get the street name from a CLLocation in iOS?

In my app I'd need to know the name of the street the user is in. At the moment I only know hot to get the user location with the

object and to show it in a
but I can't find any way to get the name of the street where the user is.

Is there a way to do this with or without the iOS sdk?

Answer Source

From iOS 5 and on, you can do this making use of CLGeocoder. I strongly advise you to take a look at the Location Awareness Programming Guide, here.

In order to get the street, you should make a request using reverseGeocodeLocation:completionHandler:. In that completion handler you will receive an array of CLPlacemark objects. To get the street, just extract the object from the addressDictionary dictionary in the CLPlacemark object using the kABPersonAddressStreetKey key.

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