Search code examples
objective-ccocos2d-iphoneccsprite

my sprite is undeclared?


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.

@interface MyNode : CCNode{
CCSprite *Bsprite1, *Tsprite1, *currentSprite;  
Boolean isChanging;

}
@end

currentSprite = [c1array objectAtIndex:i];
//error 'currentSprite' undeclared.

Solution

  • i got it working had to create a pointer to it MyNode *currentSprite