Search code examples
cocoamacosfmdb

how to create sqlite database at fix location


How can I create Sqlite database file at a fix location. I am using FMDB wrapper to create database file. I want to create the database file at the location I am entering.


Solution

  • where do you want to storage your database?

    fmdb makes it very easy by FMDatabase* db = [FMDatabase databaseWithPath:@"/tmp/tmp.db"];

    you could just change "/tmp/tmp.db" to the location of your preference, maybe the application support folder.