开发者

CCSprites class cast exception in android?

开发者 https://www.devze.com 2023-04-10 17:20 出处:网络
I have one problem in inheriting CCSprites in java, i post some of codes here, public class Block extends CCSprite

I have one problem in inheriting CCSprites in java, i post some of codes here,

public class Block extends CCSprite
  {
stati开发者_Python百科c Block temp=null;
     ...
     ...
   static Block newBlock(tetrominoTypes blockType)
      {
        temp = (Block) Block.sprite(filename); // class cast exception here

   }
return temp;
 }

...... }

Class cast expection occur on runtime , how can i resolve it.If any one knows means help me out.


sprite seems to be a static function of the mother class.

Maybe try :

temp = (Block) CCSprite.sprite(filename);
0

精彩评论

暂无评论...
验证码 换一张
取 消