title: Why is NSFileManager not working?
body: <p>I've written some code to copy a file (dbtemplate.sqlite) from the application package to the library. However, no file shows up in the library and every time I start the application it logs the text that it copied the template. There are no errors showing up in the console. What am I doing wrong?</p>
  
  <pre><code>NSFileManager *fileManager = [NSFileManager defaultManager];
  
  if (![fileManager fileExistsAtPath:@"~/Library/AppSafe/database/db.sqlite"]) {
  
      [fileManager createDirectoryAtPath:@"~/Library/AppSafe/database" withIntermediateDirectories:YES attributes:nil error:nil];
  
      [fileManager copyItemAtPath:@"dbtemplate.sqlite" toPath:@"~/Library/AppSafe/database/db.sqlite" error:nil];
      NSLog(@"copied template");
  
  }
  </code></pre>