Changing the sprite of an object included in a CCSpriteBatchNode


I have an object called Rock, this inherits from CCSprite.
I have added that as a child to a CCSpriteBatchNode, which is associated with a texture containing 2 sprites (boulder_1.png, and boulder_1_broken.png).
These were loaded in earlier as spriteframes from a plist file.

When the Rock object reaches half health, I want to be able to change the sprite.
I am trying to do this with this:


as I did to setup the sprite but this throws an error when tried to draw.

Does anyone know another way I should be re-setting the image on the object?
Thanks in advance.


You should not call init… on already initialized objects.


Thanks a lot.
It is Monday, I am really not with it today haha


Wasn’t quite what I needed put it pointed me in the right direction.
Since all my sprites are already loaded as sprite frames I did this instead:


But thanks a lot =D