title: How to handle error code -43 from NSOSStatusErrorDomain when initializing AVAudioPlayer Object?
body: <p>I observed strange behavior while working with AVAudioPlayer</p>
  
  <p>Following is the code:</p>
  
  <pre><code>AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@",fileName]] error: &amp;error];
  </code></pre>
  
  <p>In this, I downloaded the file from server and stored in application's Cache directory.</p>
  
  <p>I am getting following error:</p>
  
  <pre><code>Error in playing =
  Domain = NSOSStatusErrorDomain
  Code = -43
  Description = Error Domain=NSOSStatusErrorDomain Code=-43 "The operation couldn’t be completed. (OSStatus error -43.)"
  </code></pre>
  
  <p>I also verified that file is present at that location.
  Everytime I restart my application, I was getting same error for song play.
  After some time, when I tried to run same code, my player just works fine without any error.</p>
  
  <p>Can anyone tell me how to handle this error?</p>
  
  <p>Also, Can anyone explain me what was the problem?</p>