Arrow *Arrow::createArrowByLevel(const std::string &level){ Arrow *newArrow = new (std::nothrow) Arrow(level); if (newArrow && newArrow->initArrow()){ newArrow->autorelease(); return newArrow; } delete newArrow; newArrow = nullptr; return nullptr; }
Arrow* Arrow::create(b2World* pWorld) { // 'layer' is an autorelease object Arrow *pRet = new Arrow(); if (pRet && pRet->init(pWorld)) { pRet->autorelease(); return pRet; } else { delete pRet; pRet = NULL; return NULL; } // return the scene return pRet; }