title: SQLite database always empty (FMDB)
body: <p>I'm doing a very classic routine that i've done multiple times, but in this project, its not working. When I want to work with my DB, I get " No such tables " errors. Which should be wrong. I checked the bundle database and its fine ; I checked the "result" db in the phone and its completly empty (no structure, and obviously no data).</p>
  
  <p>Here is my DB creation routine. I call it every time I need the database.</p>
  
  <pre><code>+ (FMDatabase*)createAndCheckDataBase{
      BOOL success;
      NSArray *docPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString *documentsDir = [docPaths objectAtIndex:0];
      NSString *databasePath = [documentsDir stringByAppendingPathComponent:@"database.sqlite"];
      NSFileManager *fileManager = [NSFileManager defaultManager];
      success = [fileManager fileExistsAtPath:databasePath];
  
      //The database already exist in the application folder, we don't need to create it
      if(success){
          return [FMDatabase databaseWithPath:databasePath];
      }
  
      NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"database.sqlite"];
      [fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil];
  
      return [FMDatabase databaseWithPath:databasePath];
  </code></pre>
  
  <p>Then i just do <code>FMDatabase *db = [DatabaseManager createAndCheckDatabase];</code>and i supposedly get my db. But i don't.</p>
  
  <p>I created the sqlite database using the SQLite Manager plugin from Firefox, created the structure there, then imported it into the bundle.</p>
  
  <p>Note : success always return true.</p>
  
  <p>Any help is most welcome!</p>