如何使用坐标获取当前区域名称?

Nic*_*Nic 1 iphone

我只需要当前的位置详情,

我已经完成了获取当前位置坐标的部分.

现在我想使用这些坐标获取区域名称等(无地图)详细信息.

怎么做?有可用的示例代码吗?

提前致谢.

mar*_*rcc 5

实施 MKReverseGeocoderDelegate

implements <MKReverseGeocoderDelegate>
Run Code Online (Sandbox Code Playgroud)

添加实例变量:

MKReverseGeocoder *_reverseGeocoder;
Run Code Online (Sandbox Code Playgroud)

创建反向地理编码器对象:

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];
Run Code Online (Sandbox Code Playgroud)

实现以下委托功能:

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark  
{
    /// placemark has your location!
}
Run Code Online (Sandbox Code Playgroud)