pushScene and popScene or replaceScene . which should we use and when ?
- by srikanth rongali
I am using push scene to get the next scene. But, I read that for each PushScene the scene is stored in stack. The memory usage is more. So, I am using the replaceScene in place of pushScene. But, with replace scene I am getting the memory-bad-access message in debugger.
So, I want to popScene after using it, so that the retain count is zero. But, I am confused in using popScene.
If I have a Scene1 and Scene2. I used the following to go in to Scene2. Now I need to remove Scene1 from stack.
[[CCDirector sharedDirector] pushScene:Scene2];
Where should I write the popScene to popScene1. How to get the previous scene in current running scene ?
Thank you/