Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ipad HandleLongPress手势:移动鼠标时仅设置一个pin_Ipad_Mkmapview - Fatal编程技术网

Ipad HandleLongPress手势:移动鼠标时仅设置一个pin

Ipad HandleLongPress手势:移动鼠标时仅设置一个pin,ipad,mkmapview,Ipad,Mkmapview,我正在使用HandleLongPress手势功能在MKMap上设置pin。但是,当我按下长键并移动移动时,地图上会出现很多大头针 我能做些什么来阻止这一切 致以最诚挚的问候您必须检查状态,如 - (void)longPressGestureDetected:(id)sender { UILongPressGestureRecognizer* gesture = (UILongPressGestureRecognizer*)sender; UIGestureRecognizerSt

我正在使用HandleLongPress手势功能在MKMap上设置pin。但是,当我按下长键并移动移动时,地图上会出现很多大头针

我能做些什么来阻止这一切


致以最诚挚的问候

您必须检查状态,如

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

我想出来了。我将所有代码放入->if(sender.state==UIgestureRecognitizerStateEnded)