UserScene* UserScene::create() { UserScene *pRet = new(std::nothrow)UserScene(); if (pRet && pRet->init()) { pRet->autorelease(); return pRet; } else { delete pRet; pRet = NULL; return NULL; } }
void ChatScene::userCallback(Ref* sender) { Director::getInstance()->getScheduler()->pauseTarget(this); Scene* pScene = Scene::create(); UserScene* pLayer = new UserScene(); pLayer->setUserQueue(userQueue); if(pLayer&&pLayer->init()) { pScene->addChild(pLayer); CCLOG("Director pushScene"); Director::getInstance()->pushScene(pScene); } else { delete pLayer; pLayer = NULL; } }