Game Development Reference
// Sent to the previous scene right before its dealloc method is run.
// If using a CCTransitionScene: sent when the transition has ended.
// Sent to the previous scene only when using a CCTransitionScene.
// It's sent when the transition begins, at the same time as the
// new scene's onEnter method is run.
Note If you don't make the call to the super implementation in the onEnter
methods, your new scene won't react to touch or accelerometer input. If you
don't call super in onExit , the current scene won't be released from
memory. Similar issues may occur if you don't call the super implementation
in the other two methods. Because it's easy to forget this, and the resulting be-
havior doesn't lead you to realize that it may be related to these methods, it's
important to stress this point.
These methods are useful whenever you need to do something in any node ( CCNode ,
CCLayer , CCScene , CCSprite , CCLabelTTF , and so on) right before a scene is
changed or right after. The difference from simply writing the same code in a node's
init or dealloc method is that the scene is already fully set up during onEnter ,
and it still contains all nodes during onExit .
That can be important. For example, if you perform a transition to change scenes, you
may want to pause certain animations or hide user interface elements until the trans-
ition finishes. Here's the sequence in which these methods get called when using a