title: Play a song in iOS
body: <p>I was trying to play a song in iOS, but it gives me an error message.</p>
  
  <h3>HEADER FILE .h</h3>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  
  @interface PRPViewController : UIViewController{
      AVAudioPlayer *audioPlayer;
      IBOutlet UIButton *start;
  }
  
  -(IBAction)play;
  
  @end
  </code></pre>
  
  <h3>IMPLEMENTATION FILE .m</h3>
  
  <pre><code>NSURL *url = [NSURL fileURLWithPath:
                   [NSString stringWithFormat:@"%@/bobmarley.mp3",          
                       [[NSBundle mainBundle] resourcePath]]];
  
  NSError *error;
  audioPlayer = [[AVAudioPlayer alloc] initWithContentsofURL:url error:&amp;error];
  audioPlayer.numberOfLoops = 0;
  
  [audioPlayer play];
  </code></pre>
  
  <h3>but it says</h3>
  
  <blockquote>
    <p>No visible @interface for AVAudioPlayer declares the selector 'initWithContentsofUrl:error:'</p>
  </blockquote>
  
  <p>What should I do?</p>