I am using the MapKit for the iPhone and have it setup to get the user's location and display it on the view. But I need to know which state they're in so I know what data to load and display to the user. Is there any way to get that sort of info?
views:
47answers:
2
+1
A:
Have a look at the CurrentAddress code sample:
It makes use of the MKReverseGeocoder class that provides services for converting your map coordinate (specified as a latitude/longitude pair) into information about that coordinate, such as the country, city, or street. A reverse geocoder object is a single-shot object that works with a network-based map service to look up placemark information for its specified coordinate value. To use placemark information is leverages the MKPlacemark class to store this information.
Ben S
2010-03-15 00:54:27
Ok, yeah, the MKPlacemark's administrativeArea gives you the state. It says in the documentation that it gives EITHER the abbreviation or the entire name. Now to determine how to get the abbreviation. Thank you!
2010-03-15 01:08:20