2011-09-22 24 views
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 
+0

你可以包括你的錯誤,因爲它顯示在控制檯上。 – rptwsthi

回答

2

包括box2d並確保此標頭的實現擴展名爲.mm而不是.m(用於支持C++)。