coreLocation 정보 - 지리적 위치 역코딩
사용법:
1. 먼저 프로토콜 MKReverseGeocoderDelegate를 실현해야 한다. 좌표 정보를 서버에 보내고 다시 되돌리는 데 일정한 시간이 걸리기 때문에 막히는 것을 방지하기 위해 메시지를 보낸 후 언제까지 정보를 되돌려줄지 모르기 때문에 정보가 되돌아올 때 의뢰 방법을 알린다.여기서 이 유형을 실현할 때 주로 두 가지 방법을 실현하기 위해 다음과 같다.
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{
NSLog(@"MKReverseGeocoder has failed.");
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
NSLog(@" :%@",placemark);
}
didFailWithError 이 방법은 잘못된 정보를 되돌려주는 것을 처리하기 위한 것이고, didFindPlacemark는 지리 정보를 되돌려주는 것이다. 지리 정보는placemark에 포함되며, 이 대상에는 국가, 도시, 블록, 거리 등 구성원 변수가 포함된다.
2, 그리고 init 인코더를 사용할 수 있습니다. 그리고 요청을 보냈습니다.
MKReverseGeocoder *reverseGeocoder =[[MKReverseGeocoder alloc] initWithCoordinate:coordinate];
NSLog(@"%g",coordinate.latitude);
NSLog(@"%g",coordinate.longitude);
reverseGeocoder.delegate = self;
[reverseGeocoder start];
MKReverseGeocoder는 start 방법 외에 cancel 방법으로 요청을 취소합니다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
집 서버 설계 (하드웨어 편)자신의 Redmine이나 ownCloud를 운용하기 위해 사쿠라 VPS, DigitalOcean, OpenShift 등을 놀랐습니다만, 침착 해 왔으므로 현상을 정리하고 싶습니다. 먼저 하드웨어 구성을 정리합니다. ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.