title: Audio Not Playing in iOS Simulator?
body: <p>My app opens perfectly in the simulator, but when I press my button to play, no sound plays. The button appears to be pressed, but no audio is played. Is the issue with my code, or the simulator?</p>
  
  <p>Here's my ViewController.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  
  @interface ViewController : UIViewController &lt;AVAudioPlayerDelegate&gt; {
  
  }
  
  - (IBAction)Whaddup;
  - (IBAction)Speak;
  - (IBAction)Hail;
  
  @end
  </code></pre>
  
  <p>and my ViewController.m</p>
  
  <pre><code>#import "ViewController.h"
  #import &lt;AVFoundation/AVFoundation.h&gt;
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  
  
  
  - (IBAction)Whaddup {
      NSString *path = [[NSBundle mainBundle] pathForResource:@"Whaddup" ofType:@"wav"];
      AVAudioPlayer *theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
      [theAudio play];
  }
  
  - (IBAction)Hail {
      NSString *path = [[NSBundle mainBundle] pathForResource:@"Hail" ofType:@"wav"];
      AVAudioPlayer *theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
      [theAudio play];
  }
  
  - (IBAction)Speak {
      NSString *path = [[NSBundle mainBundle] pathForResource:@"Speak" ofType:@"wav"];
      AVAudioPlayer *theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
      [theAudio play];
  }
  
  
  
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>
  
  <p>Does anybody have an idea as to why this isn't working? I have my three buttons linked up with my First Responders, using the "Touch Up Inside" for each button.</p>