How to get current Region Name using Coordinates?
I just need current location details,
I have done the part of getting Current location Coordinates.
Now i want to get the region name, etc (No Maps) details using these coordinates.
开发者_C百科How to do that? Any sample code available?
Thanks in advance.
implement the MKReverseGeocoderDelegate
implements <MKReverseGeocoderDelegate>
Add an instance variable:
MKReverseGeocoder *_reverseGeocoder;
Create your reverse geocoder object:
CLLocationCoordinate2D location;
location.latitude = latitude; // You said you had this value
location.longitude = longitude; // You said you had this value
_reverseGeocoder = [[MKReverseGeocoder alloc]initWithCoordinate:location];
_reverseGeocoder.delegate = self;
[_reverseGeocoder start];
Implement the following delegate function:
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
/// placemark has your location!
}
You can use MKReverseGeocoder.
精彩评论