title: AVAudioPlayerDelegate method doesn't seem to work
body: <p>I'm simply trying to do something when an audio file has finished playing, but it doesn't seem to work.</p>
  
  <p>In my .h file I've got this:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "AppDelegate.h"
  #import &lt;AVFoundation/AVFoundation.h&gt;
  #import &lt;CoreAudio/CoreAudioTypes.h&gt;
  
  @interface soundViewController : UIViewController
  &lt;AVAudioPlayerDelegate&gt;
  {
      //various outlets
  }
  @property (strong, nonatomic) AVAudioPlayer *audioPlayer;
  
  @end
  </code></pre>
  
  <p>And in the .m file I've got:</p>
  
  <pre><code>#import "soundViewController.h"
  @interface soundViewController ()
  @end
  
  @implementation soundViewController
  @synthesize audioPlayer;
  </code></pre>
  
  <p>And the method's:</p>
  
  <pre><code>- (void) playWord{
      Word *currentWord = [[Word alloc]init];
      currentWord = [testWords objectAtIndex:wordNum-1];
      NSString *item = [currentWord word];
      NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@.mp3", [[NSBundle mainBundle] resourcePath], item]];
  
      NSError *error;
      audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&amp;error];
  audioPlayer.numberOfLoops = 0;
  if (audioPlayer == nil){
      NSLog(@"error in audioPlayer");
      }
  else{
      [audioPlayer play];
          NSLog(@"Playing word");
      }
  }
  
  - (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag{
      if (flag==YES){
          NSLog(@"Finished!");
      }
  }
  </code></pre>
  
  <p>So... it all works swimmingly (apart from the fact that the sound file won't work if it starts with a capital letter), but why am I not seeing the log message "Finished" when the sound finishes?</p>
  
  <p>Thanks for your help,
  Morten</p>