For循环中的奇怪错误

cre*_*row 2 objective-c

你好那里的编码员.在过去的几周里,我一直在学习GLKit.我找到了这个非常有用的系列教程,介绍如何设置这里的基本2D图形引擎.

当我按照"Iteration 5"代码的第一块时,发生了一些奇怪的事情.方法中的for循环updateVertices出现编译器错误.这些错误显示在这里.

错误

这是完整的类代码.

//
//  Elipse.m
//  EmptyGLKit
//
//  Created by C-R on 8/6/13.
//  Copyright (c) 2013 C-R. All rights reserved.
//

#import "Ellipse.h"

#define ELLIPSE_RESOLUTION 64;
#define M_TAU (2*M_PI)

@implementation Ellipse

-(int)numVertices {
    return ELLIPSE_RESOLUTION;
}

-(void)updateVertices {
    for (int i = 0; i < ELLIPSE_RESOLUTION; i++) {
        float theta = ((float)i) / ELLIPSE_RESOLUTION * M_TAU;
        self.vertices[i] = GLKVector2Make(cos(theta)*radiusX, sin(theta)*radiusY);
    }

}

-(float)radiusX {
    return radiusX;
}

-(void)setRadiusX:(float)_radiusX {
    radiusX = _radiusX;
    [self updateVertices];
}

-(float)radiusY {
    return radiusY;
}

-(void)setRadiusY:(float)_radiusY {
    radiusY = _radiusY;
    [self updateVertices];
}

@end
Run Code Online (Sandbox Code Playgroud)

我已经尝试关闭并重新打开项目,清理代码,重新启动Xcode,但都没有成功.

据我所知,for循环是完全可以接受的,并且已经在我的其他几个项目中.

Wai*_*ain 13

你的#define生产线最后有一个;.这是不正确的,应该删除.该#define基本上是代入汇编代码,所以最终的结果是一个if语句有太多的;在它的字符.