8

I want to provide a user-input field in my iPad app, where the user can type the name of a city or location, and the app should present a list of possible cities/locations where the user can select from, and I can get the geo coordinates from (to add markers on a MKMapView).

I tried CLGeocoder, but it seems it only gets me one result, plus the result ain't that accurate. For example, putting "Stutt" as address string yields "Straubing, germany" as result, wheareas "Stuttgart" will bring up "Stuttgart" (correct) as result (I would thus expect at least 2 results for "Stutt"). Also, theres a city called stuttgart in the US, which also was not given as result. (i used the sample code on the very bottom of this page: https://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/LocationAwarenessPG/UsingGeocoders/UsingGeocoders.html)

Can anyone guide me to a proper solution for city name/location lookup based on user text input?

user826955
  • 3,137
  • 2
  • 30
  • 71

1 Answers1

7

Found a solution:

The geonames webservice and the objective-c client api.

The client api also brings a ready-to-use search controller.

Robert
  • 1,936
  • 27
  • 38
user826955
  • 3,137
  • 2
  • 30
  • 71
  • Thanks so much for answering your question! This was EXACTLY what I was looking for! You should mark this as the correct answer that way more people can find it! – sridvijay Jun 28 '12 at 16:02
  • Thanks for the hint, wasn't aware that I should accept my own answer :) – user826955 Jun 29 '12 at 06:47