title: iPhone (iOS): copying files from main bundle to documents folder error
body: <p>I am trying to copy some files across from my app bundle to the documents directory on first launch. I have the checks in place for first launch, but they're not included in code snippet for clarity. The problem is that I am copying to the documents directory (which already exists) and in the documentation, it states that: </p>
  
  <blockquote>
    <p><em>dstPath</em> must not exist prior to the operation.</p>
  </blockquote>
  
  <p>What is the best way for me to achieve the copying straight to the documents root? The reason I want to do this is to allow iTunes file sharing support.</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSString *sourcePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Populator"];
  
    NSLog(@"\nSource Path: %@\nDocuments Path: %@", sourcePath, documentsDirectory);
  
    NSError *error = nil;
  
    if([[NSFileManager defaultManager] copyItemAtPath:sourcePath toPath:documentsDirectory error:&amp;error]){
      NSLog(@"Default file successfully copied over.");
    } else {
      NSLog(@"Error description-%@ \n", [error localizedDescription]);
      NSLog(@"Error reason-%@", [error localizedFailureReason]);
    }
    ...
    return YES;
  }
  </code></pre>
  
  <p>Thanks</p>