**Many Thanks people! I used jeffaphone and Martin H's answers, Been staring at this for hours thank you so much :)**
I'm working on a project where I have a short sound file that plays every 1.35 seconds when the game is running but when the game stops how do I turn off the timer? If you do nothing the sound file continues to loop and a new loop will begin if you start the game again etc.
The code I have so far is this;
if ((self.currentState = GameStateRunning)) {
self.timer = [NSTimer scheduledTimerWithTimeInterval:1.35 target:self selector:@selector(sound:) userInfo:nil repeats:YES];
// [self sound:nil];
}
else if ((self.currentState = GameStateEnded)) {
[sound removeAllActions];
I've tried stopping the sound but that doesn't seem to work so is there a way to stop or reset the timer so the loop will stop until the game starts up again?