1 child->retain();//引用计数+1 2 3 child->removeFromParent(); 4 5 root->addChild(); 6 7 child->release(); //引用计数-1
需要注意的是retain()和release(),如果在卸载节点前不调用retain的话会导致报错
CCAssert( child->m_pParent == NULL, "child already added. It can't be added again");
release()要和retain()成对使用,否则会引起内存泄露