VansFannel
VansFannel

Reputation: 45921

How can I find a city and show it on a MKMapView?

I'm developing an iPhone application to search cities on a MKMapView. The user specify a city and then it show its location on a MKMapView. Is that possible?

Thanks.

Upvotes: 0

Views: 2604

Answers (1)

samvermette
samvermette

Reputation: 40437

EDIT: iOS 5 now includes CLGeocoder, which will do just that for you.

You could use Google's Geocoder REST API. A request looks like this:

http://maps.google.com/maps/api/geocode/json?address=city&sensor=true_or_false

Since the response is in JSON format, you'll need a JSON parser.

Upvotes: 2

Related Questions