2012-12-17 76 views
-2

我建设类的说明符或限定符子类CCSprite的:对象需要在对象C类

的问题是我不断收到“类型名称需要说明符或限定词”。

我有代码评论我在哪里得到的错误。林不知道我做错了什么。

int tileSize = 80; 
Boolean moveable = true; 
id moveUp,moveRight,moveDown,moveLeft; 

@interface Player : CCSprite { 

//On these lines. 
moveUp = [CCMoveTo actionWithDuration:2 position:ccp(0, 0 - tileSize)]; 
moveDown = [CCMoveTo actionWithDuration:2 position:ccp(0,0+tileSize)]; 
moveRight = [CCMoveTo actionWithDuration:2 position:ccp(0+tileSize,0)]; 
moveLeft = [CCMoveTo actionWithDuration:2 position:ccp(0-tileSize,0)]; 


} 


-(void)move; 



@end 


@implementation Player{ 





@end 
+2

我强烈建议您在熟悉基本知识之前不要写另一行Objective-C代码。 – trudyscousin

回答

3

你不能在你的界面中放置代码 - 它需要在方法或函数中。应该在那里的唯一的东西是属性列表。