title: NSBundle File References Lost After App Reinstalled
body: <p>I save a user preference for an audio file in <code>NSUserDefaults</code> with a URL built like this:</p>
  
  <pre><code>soundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/audioFile1.m4r", [[NSBundle mainBundle] resourcePath]]];
  </code></pre>
  
  <p>That preference is subsequently retrieved like this:</p>
  
  <pre><code>self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:self.audioURL error:&amp;error];
  </code></pre>
  
  <p>This has worked great and I've had no trouble until recently when the app went into adhoc deployment through TestFlight for beta testing.  Now, upon reinstalls of the app, the sound doesn't play.  Logging shows that the path relies on a GUID (or equivalent) that has changed with the new install:</p>
  
  <pre><code>file://localhost/var/mobile/Applications/D74D8B09-5B27-4EF9-A344-68304CFE5549/myApp.app/audioFile1.m4r
  </code></pre>
  
  <p>was stored in the preferences, but the URL when built in the subsequent install is:</p>
  
  <pre><code>file://localhost/var/mobile/Applications/5F607CD7-6E32-45F0-9897-0DDBACBDD6B0/myApp.app/audioFile1.m4r
  </code></pre>
  
  <p>So my questions are: Am I doing it wrong?  If so, what is the correct way?  Why does this only happen under TestFlight?</p>