I have one problem in inheriting CCSprites in Java. Here is part of my code:
public class Block extends CCSprite
{
static Block temp=null;
static Block newBlock(tetrominoTypes blockType)
{
temp = (Block) Block.sprite(filename); // class cast exception here
return temp;
}
}
A class cast exception occurs at run time on the indicated line, how can I resolve it?
newkeyword in Java.. But I guess your error simply occurs becauseBlock.spritedoesn't return aBlockobject, but aSprite. – bummzack Oct 4 '11 at 6:44