title: Sound not playing in iOS Simulator. No errors
body: <p>I have constructed some code that is supposed to play audio when a button is clicked. There are no errors in the code, but when I open the iOS Simulator and press the button, no sound plays. The button does the tap animation, but nothing happens. 
  I have both the AVFoundation and AudioToolbox frameworks. 
  I also have my audio file in resources. 
  I am not using breakpoints. 
  The button is set to use the 'playAudio:' first responder upon Touch Up Inside.</p>
  
  <p>Here is my 'ViewController.h' file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;AudioToolbox/AudioToolbox.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  
  @interface ViewController : UIViewController
  
  @property (strong, nonatomic) AVAudioPlayer *audioPlayer;
  - (IBAction)playAudio:(id)sender;
  
  @end
  </code></pre>
  
  <p>And here is my 'ViewController.m' file:</p>
  
  <pre><code>#import "ViewController.h"
  #import &lt;AVFoundation/AVFoundation.h&gt;
  #import &lt;AudioToolbox/AudioToolbox.h&gt;
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  - (IBAction)playAudio:(id)sender {
      AVAudioPlayer *audioPlayer;
      NSString *audioPath = [[NSBundle mainBundle] pathForResource:@"AudioFile" ofType:@"wav"];
      NSURL *audioURL = [NSURL fileURLWithPath:audioPath];
      audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:audioURL error:nil];
      [audioPlayer play];
      sleep(5);
  };
  
  -(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>The audio segment is about 3 seconds.</p>
  
  <p>Any help is much appreciated!
  Thanks!</p>