title: NSBundle folder not found on device, but works in simulator
body: <p>I'm having a really weird problem with the iPad app I'm writing. On startup I want to copy a folder containing a few other folders (that are empty) from the application bundle to the Documents directory. The folder to be copied, called 'flds' (all lowercase), was added to the Xcode 4 project using 'Create folder references for any added folders', and I have checked that it is actually part of the .app file after compiling. (And that it doesn't exist already when attempting to copy.)</p>
  
  <p>I've tried getting to the 'flds' folder using either one of these calls (they all work):</p>
  
  <pre><code>[[[NSBundle mainBundle] bundleURL] URLByAppendingPathComponent:@"flds"]
  [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"flds"]
  [[NSBundle mainBundle] pathForResource:@"flds" ofType:@""]
  </code></pre>
  
  <p>Then copying using NSFileManager's <code>copyItemAtPath:toPath:error:</code> method (or the URL equivalent when using URL instead of path string). </p>
  
  <p>All of these strategies work perfectly in the iPad Simulator and on the iPad device, with the following exception: When I (successfully) build for Ad Hoc distribution, drag the .app and the .mobileprovision into iTunes, sync and then run the app on the device, the system no longer thinks the 'flds' folder exists! I've been trying to examine this for many hours, with no luck. Again, I'm perfectly sure it works both in the simulator and on the device running from Xcode, but not when synced via iTunes. </p>
  
  <p>Ideas?</p>
  
  <p>I discovered that the following call gets the folder path successfully also after syncing the iPad app via iTunes:</p>
  
  <pre><code>[[NSBundle mainBundle] pathForResource:@"flds" ofType:nil inDirectory:nil]
  </code></pre>
  
  <p>However, when I use this path to copy the folder to its new location in the Documents directory, only the folder itself and the .txt file in it (which I put in there as a test, it's not really supposed to be there) gets copied, and not the 6-7 empty subfolders. Again, the same pattern shows itself: Works as expected both on simulator and device running from Xcode ('flds' folder with 'test.txt' and empty subfolders are copied successfully), but not when synced via iTunes (only 'flds' folder with 'test.txt' are copied, not subfolders). Is this really the intended behaviour of <code>copyItemAtPath:toPath:error:</code>? And why would it behave differently after syncing via iTunes?</p>