I am attempting to pause the game when the user navigates away from the app or clicks on the ad using the following code:
SKView *view = (SKView *)self.window.rootViewController.view;
view.paused = YES;
This used to work in pausing the game, but due to some other stuff going on, I ended up adding another viewcontroller to handle the title scene, and got everything working, but for some reason the pause code now doesn't work and I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setPaused:]: unrecognized selector sent to instance 0x170174280'
Note that I am still able to pause within my scene using
self.scene.view.paused = YES;
Does anyone know why this might be happening? Through reading some of the other related questions, I can see that it might be useful to use NSNotification? Another option is to add an observer? Does anyone know why the pause code I am using is not working from the appDelegate anymore and what I can do to fix this?