在我的长按手势中,我遇到了一个问题,例如,
*mypressrec = [[UILongPressGestureRecognizer alloc]
initWithTarget:self
action:@selector(pressdetected:)];
mypressrec.minimumPressDuration = 3;
[self addGestureRecognizer:mypressrec];
[mypressrec release];
我的功能:
-(void)pressdetected:(UILongPressGestureRecognizer*)recognizer{
//My code goes here
a=90;
NSLog(@"value of my A",a);
}
在这里,当我按下超过 3 秒时,我的 A 的值正在打印TWICE。为什么会发生?