title: Objective-c no known class method for selector 'playAtTime'
body: <p>I'm trying to program an alarm to go off at a user set time using <code>AVAudioPlayer</code> and <code>playAtTime</code> and when I use this code <code>[AVAudioPlayer playAtTime:dateTimeString];
  </code> to try and get it to play at the user set time, I get this error <code>no known class method for selector 'playAtTime'</code>. The rest of my code is as follows </p>
  
  <pre><code> #import "ViewController.h"
  
   @interface ViewController()
   {
        AVAudioPlayer *_myPlayer;
   }
  @end
  
  @implementation ViewController
  
   - (void)viewDidLoad
  {
   [super viewDidLoad];
   // Do any additional setup after loading the view, typically from a nib.
  
  NSString *path = [NSString stringWithFormat:@"%@/drum01.mp3", [[NSBundle mainBundle] resourcePath]];
  NSURL *soundUrl = [NSURL fileURLWithPath:path];
  _alarmPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundUrl error:nil];
  
  }
  
  -(IBAction) alarmSetButtonTapped:(id)sender {
  
  NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  NSString *dateTimeString = [dateFormatter stringFromDate: dateTimePicker.date ];
  NSLog( @"Set button tapped : %@", dateTimeString );
  
  [AVAudioPlayer playAtTime:dateTimeString];
  
  [self scheduleLocalNotificationWithDate: dateTimePicker.date];
  
  }
  
  - (void)didReceiveMemoryWarning
  {
    [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>
  
  <p>And the viewcontroller.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AvFoundation/AVFoundation.h&gt;
  
  @interface ViewController : UIViewController &lt;AVAudioPlayerDelegate&gt;
    {
       IBOutlet UIDatePicker *dateTimePicker;
    }
  
  
   -(IBAction) alarmSetButtonTapped:(id)sender;
  
   @end
  </code></pre>
  
  <p>How do I fix this error and use <code>playAtTime</code>?</p>
  
  <p>Thanks</p>