I have subclassed NSCoding
and added my game specific stuff to it such as health etc. I have serialised the object I have subclassed however upon decoding and then adding the sprite to the screen via [self addChild:sprite]
, it fails to draw the sprite to the screen.
I am guessing this is because CCSprite
needs to also implement the NSCoding
protocol so my questions are:
1) Am I right about my assumption above (I don't want to waste time implementing this solution to only find out this is not the issue)
2) What is the best way to get CCSprite
to implement NSCoding
? Is it to use Categories or just subclass it and force the subclass to implement the NSCoding
protocol?