RT,发现CCArray的copy函数没多态化,直接调用CObject的copy函数,导致崩溃。不知道是不是这样?
CCObject* CCCopying::copyWithZone(CCZone *pZone)
{
CC_UNUSED_PARAM(pZone);
CCAssert(0, "not implement");
return 0;
}
……
CCObject* CCObject::copy()
{
return copyWithZone(0);
}
……
class CC_DLL CCArray : public CCObject
{
public:
……
static CCArray* createWithArray(CCArray* otherArray);
……
}
……
CCArray* CCArray::createWithArray(CCArray* otherArray)
{
CCArray* pRet = (CCArray*)otherArray->copy();
pRet->autorelease();
return pRet;
}