i declared the sprite in my .h but how do i call the sprite from the node i declared it in so that i don't get the error that it is undeclared.
@int开发者_开发百科erface MyNode : CCNode{
CCSprite *Bsprite1, *Tsprite1, *currentSprite;
Boolean isChanging;
}
@end
currentSprite = [c1array objectAtIndex:i];
//error 'currentSprite' undeclared.
try separate the CCSprite declarations..
CCSprite* Bsprite1;
CCSprite* Tsprite1;
CCSprite* currentSprite;
I hope your currentSprite = [c1array objectAtIndex:i];
is at your .m..
i got it working had to create a pointer to it MyNode *currentSprite
精彩评论