Cocos2d-x创建CCSprite报错

RT,我在helloword工程中,新建了一个NormalGround的类,继承于CCSprite。

NormalGround* NormalGround::create(){
	NormalGround* ground = (NormalGround *)NormalGround::spriteWithFile("CloseNormal.png");
	ground->setAnchorPoint(ccp(0,0));
	ground->setPositionInPixels(ccp(100,100));
	ground->type = 0;
	return ground;
}

这是它的创建方法。我在HellowordScene里面create一个实例,并且在界面中addchild。运行没有问题。但是在关闭程序的时候报错。如下:

指针停在这里
CCSprite::~CCSprite(void)
{
CC_SAFE_RELEASE(m_pobTexture);
}

求大神解答这是怎么回事?

— Begin quote from ____

skoky 发表于 2012-9-10 15:43 url

你还是没明白啊, 不能调用父类的静态方法创建子类。其他都不管,你试试就知道了。 …

— End quote

哦。大概懂你的意思。那应该怎么重写这个类呢?还有我刚刚下的cocos2d-x找不到头文件是什么情况

— Begin quote from ____

skoky 发表于 2012-9-10 15:34 url

NormalGround* ground = (NormalGround*)NormalGround::spriteWithFile(“CloseNormal.png”);
这里你用了强 …

— End quote

:(type那个不用关心。因为我中间还有一层继承。所以在他的父类里面有这个。而且我不是在创建的时候报错的。是在关闭的时候报的错。