title: stop a sound from playing objective c?
body: <pre><code>- (void)viewDidLoad {
  [super viewDidLoad];
  [audioPlayer stop];
  NSString *Path = [[NSBundle mainBundle] pathForResource:@"Keep the Shoes Moving" ofType: @"m4a"];
  NSURL *URL = [[NSURL alloc] initFileURLWithPath: Path];
  NSError *error;
  audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:URL error:&amp;error];
  audioPlayer.numberOfLoops = -1;
  [audioPlayer play];
  [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]; }
  </code></pre>
  
  <p>What happens with this is every time I navigate back to this viewController it plays another track. So then I have two tracks playing over each other. How would I get this to stop??</p>