当我使用手势功能进行上下翻转时,会发生这种情况,请帮助解决此错误
- (void)doFlipForward:(UIGestureRecognizer *)aGestureRecognizer forOrientation:(UIInterfaceOrientation)anOrientation{
if(isAnimating)
return;
switch([aGestureRecognizer state])//There is occurred in this line
{
case UIGestureRecognizerStateBegan:
[CATransaction begin];
[CATransaction setDisableActions:YES];
[flipPage setHidden:NO];
[flipShadow setHidden:NO];
[CATransaction commit];
break;
case UIGestureRecognizerStateChanged:
{
CGFloat multiplier = 0.0f;
if(UIInterfaceOrientationIsPortrait(anOrientation))
{
multiplier = portraitMultiplierTable[(NSInteger)[aGestureRecognizer locationInView:self].x];
[thisPage setPortraitCurlAnimationPosition:multiplier];
[flipPage setPortraitCurlAnimationPosition:multiplier];
[flipShadow setPortraitCurlAnimationPosition:multiplier];
}
else
{
multiplier = landscapeMultiplierTable[(NSInteger)[aGestureRecognizer locationInView:self].x];
[thisPage setLandscapeCurlAnimationPosition:multiplier];
[flipPage setLandscapeCurlAnimationPosition:multiplier];
[flipShadow setLandscapeCurlAnimationPosition:multiplier];
}
}
break;
case UIGestureRecognizerStateEnded:
{
CGFloat transX = [(UIPanGestureRecognizer *)aGestureRecognizer translationInView:self].x;
CGFloat width = [self bounds].size.height * PAGE_RATIO;
if(width + transX < width/2)
{
[self animateOpen];
}
else
{
[self animateClose];
}
}
break;
}
}