I have created a number of CCSprites using spriteWithFile.
How do I change the image for the sprite during runtime?
I need to change a few sprites images qui
if you want to change the images continuously then write following code in your init method
CCTexture2D *tex1 = [[CCTextureCache sharedTextureCache] addImage:@"image1.png"];
CCTexture2D *tex2 = [[CCTextureCache sharedTextureCache] addImage:@"image2.png"];
CCTexture2D *tex3 = [[CCTextureCache sharedTextureCache] addImage:@"image3.png"];
CCSprite *sprite = [CCSprite spriteWithTexture:tex1];
//Make above variables as class level to access in whole class
[self addChild:sprite];
//position the sprite according to your need
write this line where you want to change the image
[sprite setTexture:tex3];