Why do this?


#1

I read TMXOrthoZorder of tests, and I find
“<1> m_tamara = CCSprite::spriteWithFile(s_pPathSister1);
<2> map->addChild(m_tamara, map->getChildren()>count);
<3> m_tamara
>retain();
”.
But I think there may not has <3>.In the <1> , the m_uReference of m_tamara is one. And in the <2>. the m_uReference is two.So I don’t know why this must add <3>. thanks.


#2

Could you please tell me where these codes are?


#3

In the tileMapTest, there is a TMXOrthoZorder class.


#4

Because m_tamara is a member variable of the class, it will be used later. So, it should invoke retain.


#5

Sorry, I don’t note this. thanks!