1
지도에 주석이있는 iPhone 응용 프로그램을 개발 중이며 모든 주석을 삽입했습니다. 나는 모든 주석 (X100)을 위해 사용했던 코드는 다음과 같습니다MapKit에서 가장 가까운 주석 목록
내가 어떻게 사용자의 위치에 가장 가까운 주석을 표시 목록의 모든 위치를 얻을 수있다에 대해 궁금 무엇CLLocationCoordinate2D theCoordinate1;
theCoordinate1.latitude = 59.92855;
theCoordinate1.longitude = 10.80467;
MyAnnotation* myAnnotation1=[[MyAnnotation alloc] init];
myAnnotation1.coordinate=theCoordinate1;
[email protected]"Økern Senter - DNB";
[email protected]"Økernveien 145, 0580 OSLO";
[mapView addAnnotation:myAnnotation1];
[annotations addObject:myAnnotation1];
?
고마워요! 두 번째 코드에서 작성한 것처럼 사용자 위치를받는 가장 좋은 방법은 무엇입니까? –
[core location framework] (http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CoreLocation_Framework/_index.html)를 사용하십시오. 그것을위한 대리자 메서드를 추가했습니다. 그러나 델리게이트 메서드가 매우 자주 반환 될 수 있으므로 계산 코드를 분리하는 것이 좋습니다. 아마도 사용자가 1cm마다 다시 계산하기를 원하지 않을 수도 있습니다. –
@GThamanTitan 문제가 해결 되었습니까? –