title: How to make my music loop (repeat)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3560161/repeat-playing-automatically">repeat playing automatically</a>  </p>
  </blockquote>
  
  
  
  <p>How can I loop a sound (my background music) </p>
  
  <p>here is my code:</p>
  
  <pre><code>NSString *path = [[NSBundle mainBundle] pathForResource:@"MathMusic" ofType:@"aif"];
      AVAudioPlayer* theAudio= [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
      theAudio.delegate = self;
  [theAudio play];
  </code></pre>
  
  <p>How can I make it ongoing and if I loop it will it still be playing in the next (or another) view?</p>