I'm new to game development with SpriteKit and everything went ok so far, but cant really the memory management part.
I created a first UIViewController to act as a level selector, a second UIViewController in which a present the SKScene of the game. The problem appears when i go back from the SKScene to the level selector and none of the memory is released.
From the game SKScene, when the user pushes the back button to go to the level selector i post a notification which tells the second UIViewController to perform the segue.
//SKScene
[self removeAllActions];
[self removeAllChildren];
[self removeFromParent];
[[NSNotificationCenter defaultCenter]postNotificationName:@"toLevelSelector" object:nil userInfo:nil];
//Second UIViewController
- (void)toLevel:(NSNotification *)notif
{
[self performSegueWithIdentifier:@"toLevelSelector" sender:self];
}
Can you help me get a better understanding on when and where should be the skview or the skscene released from memory ?