Вопрос

So I understand the code in the link below for the most part. http://phpadvocate.com/blog/2013/01/ios-6-1-simple-example-using-mklocalsearch/

However, how do I get the address for the mapItem? Seems like the other properties include: placemark, isCurrentLocation, name, phoneNumber, and url.

http://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapItem_class/MKMapItem_class.pdf

actually i am also getting the data like pizza, bar..etc but i want to phone number, street view address

Это было полезно?

Решение

Your MKLocalSearchResponse item that is created by the MKLocalSearchcompletion handler contains an array mapItems. You should iterate over this array containing all MKMapItemobjects.

foreach(MKMapItem *thisMapItem in mapItems) {
    NSLog("%@ - %@", thisMapItem.name, thisMapItem.phoneNumber);
}

You can read out every property described in your question from every thisMapItem object.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top