What you probably want to do is a combo of pausing the game and checking if the scene has been created already. When the app goes to the background you will want to use the pause method to pause your game. Then have it unpause when it comes back. Also when it comes back check if the scene has been created, if it has do NOT make another, as your app is doing.
To pause and un-pause the game you can keep a notification for that. I made mine in the view controller that holds the scene. In the viewDidLoad method add..
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willEnterForeground) name:UIApplicationWillEnterForegroundNotification object:nil];
Then for the selectors I use these methods.
- (void)willEnterForeground
{
SKView *skView = (SKView *)self.view;
skView.scene.paused = NO;
[[SKTAudio sharedInstance] resumeBackgroundMusic];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
}
- (void)willEnterBackground
{
SKView *skView = (SKView *)self.view;
skView.scene.paused = YES;
[[SKTAudio sharedInstance] pauseBackgroundMusic];
[[AVAudioSession sharedInstance] setActive:NO error:nil];
}
To make sure you don't re-make your scene, when you do make it, check if one is made already. By checking if the scene is nil. Something like..
if (!skView.scene) { make your scene here }