Android 中的 CCSprites 类强制转换异常?
我在java中继承CCSprites时遇到一个问题,我在这里发布一些代码,
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;
}
...... 运行时发生类转换
期望,我该如何解决它。如果有人知道,请帮助我。
I have one problem in inheriting CCSprites in java, i post some of codes here,
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;
}
......
}
Class cast expection occur on runtime , how can i resolve it.If any one knows means help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
sprite
似乎是母类的静态函数。也许尝试:
sprite
seems to be a static function of the mother class.Maybe try :