我正在將以下代碼寫入xcode中,並且它的大小未定:首先在此函數中使用如何解決此問題,以便我可以運行代碼?Xcode錯誤一直說大小未申報如何解決這個問題?
// on "init" you need to initialize your instance
-(id) init
{ CCSprite *spaceCargoShip = [CCSprite
spriteWithFile:@"spaceCargoShip.png"];
[spaceCargoShip setPosition:ccp(size.width/2, size.height/2)];
[self addChild:spaceCargoShip];
thatnks的答案,我已經設法修復它現在:) – sam