xcode - Cant turn off sound player when new navigation controller is pushed -


I'm playing an audio that can be turned on by following

IBAction // play Audio

  NSString * resourcePath = [[NSBundle main bundle] resource path]; SourcePath = [sourcePath stringbapping string: @ "/ Apptrack.mp3"]; NSLog (@ "Path to Play:% @", Resource Path); NSError * err; // Start our player by pointing to the path of our resource player = [[Aviideo Player Elok] initWithContentsOfURL: [NSUr File URLWithPath: Process Path] Error: & amp; Error]; If (mistake) {nslog (@ "unsuccessful reason:% @", [local demotion mistake]); } And // set up our representative and playback player. Delegate = self; [Player's game]; Player.numberOfLoops = -1; // (continuous loop use -1, or any number for the number of loops) player.currentTime = 1; Player Volume = .5; }   

IBAction to close the sound player: // close the audio

  [player pauses];   

When I push onto another view controller and come back again, the button no longer works to stop the audio and it runs continuously (loop around 3 minutes long). Then I added it to the code given above:

  if ([self player is placing] == yes) {[self. Player stop]; } And {{self. Play Player]; }   

There is still nothing, maybe some other experienced person in programming can point me in the direction of what is doing wrong?

Comments