错误消息:在开关中未处理枚举值"GameMoveNineEnum"?



我发现了一些问题,但没有任何帮助,有人能理解我为什么会出现这个错误吗?它与代码的第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;也可以。

相关内容

  • 没有找到相关文章

最新更新