In the init method of my game scene I have this:
self.accelerometer = [UIAccelerometer sharedAccelerometer];
self.accelerometer.updateInterval = 0.025;
self.accelerometer.delegate = self;
Which lets me use the accelerometer through this function:
- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
And in the dealloc function I have this to quit the accelerometer:
self.accelerometer.delegate = nil;
It works fine, great indeed. However, when I lose the game, I am given two options: Retry this same scene or go to the title screen.
When I choose to go to the title screen, then I choose the "Play" button, and I am sent to the game scene, and everything works fine.
But, when I choose the Retry option, the scene restarts just fine, but the accelerometer isn't working! I can confirm the accelerometer function isn't called (NSLog at the beginning of that method >____>)... How is that possible?