标签:ios
最近维护之前用iOS SDK 3.2写过的3年多前的map方面的模块,在地图上长按pin,发觉一个点莫名奇妙点插了两个pin。查了一下,原来是现在的sdk要在UILongPressGestureRecognizer绑定的selector方法里对UILongPressGestureRecognizer.state 进行下判断,额,蛋疼。下附问题解决办法:
//长按地图事件 - (void)longPressGestureRecognizerAction:(UILongPressGestureRecognizer* )gestureRecognizer { if (gestureRecognizer.state == UIGestureRecognizerStateEnded) { NSLog(@"Long press Ended"); } else { NSLog(@"Long press detected."); //OOXX..... } }
http://www.cocoachina.com/ask/questions/show/108149
http://blog.csdn.net/yu0089/article/details/8244851
UILongPressGestureRecognizer 执行两次的解决办法
标签:ios
原文地址:http://blog.csdn.net/aldridge1/article/details/39932001