我的代码看起来像这样:
-(void)touchBegan:(HWPoint *)point {
switch (self.states) {
case HWDrawState:
HWShape *shape = [[HWShapeManager sharedInstance] addShapeWithType:_shapeClass];
break;
case HWSelectState:
break;
case HWDeleteState:
break;
default:
break;
}
}
为什么HWShape存在问题....? 我收到了一个错误:
“错误:之前预期的表达式 'HWShape'”。
为什么?非常感谢您的回复。
答案 0 :(得分:6)
将定义括在括号中:
case HWDrawState:
{
HWShape *shape = [[HWShapeManager sharedInstance] addShapeWithType:_shapeClass];
}
break;
case ...