我发现问题已经结束,但没有任何帮助,有人可以看到我为什么会出现这个错误吗?它的代码的“(移动)”第6行有问题。谢谢

// move the spirit left/right/up/down
-(BOOL)moveSpiritWidthOrientation:(GameSpirit*)spirit moveEnum:(GameMoveEnum)move setTransform:(BOOL)trans{
    CGPoint gridPoint = [self getGridPointWithPoint:spirit.endPoint];
    CGAffineTransform transform = CGAffineTransformIdentity;
    switch (move) {
        case GameMoveTopEnum:
            gridPoint.y -= 1;
            transform = CGAffineTransformMakeRotation(-M_PI/2);
            break;
        case GameMoveBottomEnum:
            gridPoint.y += 1;
            transform = CGAffineTransformMakeRotation(M_PI/2);
            break;
        case GameMoveLeftEnum:
            gridPoint.x -= 1;
            transform = CGAffineTransformMakeScale(-1, 1);
            break;
        case GameMoveRightEnum:
            gridPoint.x += 1;
            break;
    }

最佳答案

使用default。即使是default: break;也可以。

10-08 14:44