Let's say I begin with a scene initialScene
. This scene contains a few buttons. When the user taps Button A in this scene, I will present sceneA
. So my code would look like this:
sceneA* scene = [[sceneA alloc] init];
[self.scene.view presentScene: scene];
My first question is, when an instance of sceneA
is presented from initialScene
, is it stacked on top of the initialScene
instance or does it replace it? Does the instance of initialScene
get deallocated in memory when a new scene is presented ?
I ask this because sceneA
will have a Back Button which, when tapped, returns the user to the initial scene. Can I just create a new instance of initialScene
within sceneA
and present it, or will that result in 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 there is any way I can clarify this further.