title: Convert NSData from local NSURL
body: <p>I have a sound player which uses AVAudioPlayer class. I download some items in another view and store the filepath to it as NSURL, then pass the NSURL to the Player viewcontroller. But i get an error while trying to pass the object. </p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString path]: unrecognized selector sent to instance 0x1700c86c0'
  </code></pre>
  
  <p>And here is the code:</p>
  
  <pre><code>NSData *data = [NSData dataWithContentsOfFile:[podcastSource path]];
  NSError *error;
  mPlayer = [[AVAudioPlayer alloc] initWithData:data error:&amp;error];
  [mPlayer setDelegate:self];
  
  if (mPlayer == nil)
  {
      NSLog(@"%@",error);
  }
  else
  {
      [self.player play];
  ....
  }
  </code></pre>
  
  <p>Note that the filePath i receive from the NSURL is in this form:</p>
  
  <pre><code>/var/mobile/Applications/xxxxxx/Documents/90989.mp3
  </code></pre>