2012-10-14 5 views
0

handleLongPressGesture-function을 사용하여 MKMap에 핀을 설정하고 있습니다. 그러나 내가 길게 누르고 움직임을 움직이면 많은지도가 내지도에 나타납니다.handleLongPressGesture : 마우스를 움직일 때 하나의 핀만 설정하십시오.

이 문제를 해결하려면 어떻게해야합니까? 당신은 같은 상태를 확인해야합니다

안부

+0

나는 그것을 알아 냈다. 나는 모든 코드를 -> if (sender.state == UIGestureRecognizerStateEnded) – DeFlo

답변

0

...

- (void)longPressGestureDetected:(id)sender 
{ 
    UILongPressGestureRecognizer* gesture = (UILongPressGestureRecognizer*)sender; 
    UIGestureRecognizerState state = [gesture state]; 
    if (state == UIGestureRecognizerStateBegan) { 
     set a pin here. 
    } 
} 
관련 문제