You're on the right track, the only thing missing is actually saving the bool value back to NSUserDefaults when starting / stopping the game, so every time you click the button and read it, you get the correct value.
Try and see if this helps:
-(IBAction)check { BOOL isQuiet = [userDefaults boolForKey:@"isQuiet"]; if (isQuiet) { [self playBgMusic];
Then in your playBgMusic
method add the following:
[userDefaults setBool:NO forKey:@"isQuiet"];
And in your spotBgMusic
method add the following:
[userDefaults setBool:YES forKey:@"isQuiet"];
source share