开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜