I would like to retrieve an iPhoneOS user's current city. How can I do that?
+2
A:
You do an IP to location lookup. This usually involves a database, like MaxMind's ones.
Well, I have an iPod Touch, so I forgot that the iPhone might not have an IP mapped to a city at the time (my home ip is static, so that helps too). You might also read the Core Location docs. As far as I see the CLLocation
class only communicates in Latitude, Longitude, Altitude, Heading, and Speed. You would need to have your own RTree structure of rough city boundaries to be able to make a determination, or use a web-service call, possibly to Google Maps, or GeoNames' FindNearbyPlaceName
web service (St. Gallen Example).
dlamblin
2009-09-05 09:20:08
A:
Koekiebox
2009-09-05 09:23:41