Let's say I start with the initialScene scene. This scene contains several buttons. When the user clicks button A in this scene, I represent sceneA . So my code will look like this:
sceneA* scene = [[sceneA alloc] init]; [self.scene.view presentScene: scene];
My first question is: when a sceneA instance sceneA presented from initialScene , does it fit on top of the initialScene instance or replace it? Does the initialScene instance initialScene into memory when a new scene appears?
I ask about this because sceneA will have a back button which, when clicked, returns the user to the original scene. Can I just create a new instance of initialScene inside sceneA and present it, or will this lead to multiple instances of the same scenes stacked on top of each other? Basically, can I just do this in sceneA ?:
if(...) { //if user taps back button initialScene* iniScene = [[initialScene alloc] init]; [self.scene.view presentScene: iniScene]; }
Or is there a better way to do this? Please let me know if I can explain this further.
source share