2

当我使用手势功能进行上下翻转时,会发生这种情况,请帮助解决此错误

- (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;
}

}

4

1 回答 1

18

您没有case警告中列出的值。添加以下内容以使警告静音:

default:
    break;
于 2012-07-23T07:01:42.400 回答