If the only information I have for a particular store o开发者_如何学运维r business (or restaurant etc) is its Name, Postcode (or Zipcode) and Country, how would I create an MKMapView which locates the store and drops a pin on the location? So kind of replicating if I typed in "Pizza Paradiso, WC1E 7BS, UK", except without the info bubble (but with pin)
This is called geocoding and the MapKit currently only does reverse-geocoding (from lat/long to address) using the MKReverseGeocoder class.
To do geocoding, you'll have to use some other api like the Google Geocoding API and then take the latitude and longitude it gives you to create a region which you pass to the map view's setRegion:animated:
method.
To drop a pin, you would take the resulting lat/long and create an annotation object and add it to the map view using addAnnotation.
精彩评论