title: The operation couldn’t be completed. (Cocoa error 516.)
body: <pre><code>-(void) checkAndCreateDatabase{
  
  BOOL success;
  
  NSFileManager *fileManager = [NSFileManager defaultManager];
  
  success = [fileManager fileExistsAtPath:databasePath];
  
  if(success) return;
  
  NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:databaseName];
  
  
   NSError *errr;
  
   [fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:&amp;errr];
  
   NSLog( @"Error &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; %@",errr);
  
  }
  </code></pre>
  
  <p>Using the above code database file created in iOS 5.0 simulator, but has no sql queries.
  If using iOS 4.3 simulator, it works properly working.   Below error displayed when running te app.</p>
  
  <pre><code>Error &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Error Domain=NSCocoaErrorDomain Code=516 "The operation couldn’t be completed. (Cocoa error 516.)" UserInfo=0x6a53860 {NSUserStringVariant=(
  Copy
  ), NSFilePath=/Users/sj/Library/Application Support/iPhoneSimulator/5.0/Applications/D8BF5CC1-5690-4897-A3D7-252D915D399E/MyTest.app/MyTestDB.sql, NSDestinationFilePath=/Users/sj/Library/Application Support/iPhone Simulator/5.0/Applications/D8BF5CC1-5690-4897-A3D7-252D915D399E/Documents/MyTestDB.sql, NSUnderlyingError=0x6a65510 "The operation couldn’t be completed. File exists"}
  </code></pre>