IOS4 맵킷에서 드래그 가능한 특수 효과를 얻었으며 특수 효과를 새로운 위치로 드래그하면 이벤트를 호출하려고합니다. 코드는 단순히 업데이트를 기록하고 다음 사용자 지정 메서드 내 서버로의 갱신을 보낼 주석을 알려줍니다annotationView didChangeDragState가 여러 번 실행되었습니다.
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annotationView
didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState
{
if (newState == MKAnnotationViewDragStateEnding)
{
CLLocationCoordinate2D droppedAt = annotationView.annotation.coordinate;
NSLog(@"dropped at %f,%f", droppedAt.latitude, droppedAt.longitude);
//update the annotation
//see if its an information annotation
if ([annotationView.annotation isKindOfClass:[InfoAnnotation class]]) {
NSLog(@"Info annotation updating..");
InfoAnnotation* userAnnotation = ((InfoAnnotation *)annotationView.annotation);
[userAnnotation updateLocationWithServerForConvoy: self.title];
}
}
}
: 같은
내 코드는 현재 보인다.
이 방법은 해고를 여러 번 받고있는 것 같다, 여기에 로그를 참조하십시오
2011-06-15 01:12:39.347 Convoy[1699:207] dropped at 37.340206,-122.027550
2011-06-15 01:12:39.347 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:39.658 Convoy[1699:207] dropped at 37.340206,-122.027550
2011-06-15 01:12:39.659 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:39.957 Convoy[1699:207] dropped at 37.340206,-122.027550
2011-06-15 01:12:39.958 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:43.415 Convoy[1699:207] dropped at 37.339251,-122.026691
2011-06-15 01:12:43.416 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:43.713 Convoy[1699:207] dropped at 37.339251,-122.026691
2011-06-15 01:12:43.713 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:44.006 Convoy[1699:207] dropped at 37.339251,-122.026691
2011-06-15 01:12:44.006 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:44.297 Convoy[1699:207] dropped at 37.339251,-122.026691
2011-06-15 01:12:44.297 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:54.825 Convoy[1699:207] dropped at 37.337135,-122.025833
2011-06-15 01:12:54.825 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:55.150 Convoy[1699:207] dropped at 37.337135,-122.025833
2011-06-15 01:12:55.150 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:55.475 Convoy[1699:207] dropped at 37.337135,-122.025833
2011-06-15 01:12:55.476 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:55.771 Convoy[1699:207] dropped at 37.337135,-122.025833
2011-06-15 01:12:55.772 Convoy[1699:207] Info annotation updating..
2011-06-15 01:12:56.070 Convoy[1699:207] dropped at 37.337135,-122.025833
2011-06-15 01:12:56.070 Convoy[1699:207] Info annotation updating..
내가 그것이라고 배의 금액에 1을 추가하는 것 (간격에서 예) 드래그 할 때마다. 아무도 내게이 문제의 원인이 될 수있는 아이디어를 줄 수 있습니까?
보인다. 나는 당신이 묘사하는 것과 똑같은 행동을합니다. 내가 알아 차린 점은 끌어진 주석이 MKPinAnnotationView 인 경우 잘 작동하지만 주석이 MKAnnotationView 인 경우 문제가 발생한다는 것입니다. 이오스의 버그와 매우 흡사합니다. 사과에서 열어 보겠습니다. 더 많은 압박감을 느끼기 위해서도 그렇게하고 싶습니까? –