手势识别器:应该接收触摸:方法没有被调用。我是否设置不当?
-(id) init
{
UILongPressGestureRecognizer *touchHold = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleTouchHold:)];
touchHold.minimumPressDuration = 1.0f;
touchHold.numberOfTouchesRequired = 1;
[[CCDirector sharedDirector].openGLView addGestureRecognizer:touchHold];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
return NO;
}
即使我将 bool 设置为 no,仍然会调用按住方法。