2009-11-10 5 views
1

방금 ​​현재 위치 세부 정보가 필요합니다.좌표를 사용하여 현재 지역 이름을 얻는 방법은 무엇입니까?

나는 현재 위치 좌표를 얻는 부분을 수행했습니다.

이제이 좌표를 사용하여 지역 이름 등 (지도 없음) 세부 정보를 가져 오려고합니다.

어떻게 수행하나요? 어떤 샘플 코드도 사용할 수 있습니까?

미리 감사드립니다.

답변

5

MKReverseGeocoderDelegate

implements <MKReverseGeocoderDelegate> 

인스턴스 변수를 추가 구현

,369 :

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]; 

을 다음 위임 기능을 구현

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark 
{ 
    /// placemark has your location! 
} 
+0

Marcc에게 감사드립니다. 해결책을 얻었습니다. – Nic

-1

MKReverseGeocoder를 사용할 수 있습니다. 역방향 지오 코더 객체 생성

MKReverseGeocoder *_reverseGeocoder; 

:

관련 문제