0
我有一個類,我想包含一個b2Vec2和一個整數。在「b2Vec2」之前,我一直收到一個說預期的說明符 - 限定符列表的錯誤。我無法弄清楚這一點。請幫忙。如何添加一個b2Vec2到一個類
@interface mTouch : NSObject {
b2Vec2 touchPoint;
int cannonNumber;
}
-(void)setTouchPoint:(b2Vec2)tp;
-(void)setCannonNumber:(int)cn;
-(b2Vec2)touchPoint;
-(int)cannonNumber;
@end
@implementation mTouch
-(id)init {
touchPoint = b2Vec2(0, 0);
cannonNumber = 0;
}
-(void)setTouchPoint:(b2Vec2)tp{
touchPoint = tp;
}
-(void)setCannonNumber:(int)cn{
cannonNumber = cn;
}
-(b2Vec2)touchPoint{
return touchPoint;
}
-(int)cannonNumber{
return cannonNumber;
}
@end
你可以包括你的錯誤,因爲它顯示在控制檯上。 – rptwsthi