title: Copy File to different directory in iOS
body: <p>I want to copy a file from app resources to documents directory. I'm using this code, but this will copy the file to my own application documents directory.</p>
  
  <pre><code>NSFileManager* fileManager = [NSFileManager defaultManager];
  NSArray  *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *documentsDirectory = [paths objectAtIndex:0];
  NSString *storePath = [documentsDirectory stringByAppendingPathComponent: @"TestFile.txt"];
  NSString *filePath = [[NSBundle mainBundle] pathForResource:@"TestFile" ofType:@"txt"];
  
  [[NSFileManager defaultManager] copyItemAtPath:filePath toPath:storePath error:nil];
  if (![fileManager fileExistsAtPath:getDatabasePath])  {
      NSLog(@"file doesn't exist");
      // file doesn't exist
  } else {
       NSLog(@"file exist");
  }
  </code></pre>
  
  <p>Which I have try to change this code as, but it doesn't work maybe it's something like this</p>
  
  <pre><code>NSString *storePath = [documentsDirectory stringByAppendingPathComponent: @"Applications/AppFolder/Documents/TestFile.txt"];
  </code></pre>
  
  <p>So is there any possible way to copy file to different directory?</p>