create sqlite db programmatically in iphone sdk

后端 未结 3 1848
轮回少年
轮回少年 2021-01-02 14:33

hai i a\'m trying to create a sqlite database programmatically at the run time. can anybody say how to create it in iphone sdk.

3条回答
  •  温柔的废话
    2021-01-02 15:22

    Just call the sqlite3_open function it will create a database if no database exist on the path.

    // generate databasePath programmatically
    if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) 
    {
    
    // your  code here
    }
    

    post a comment if you need more code example on this

提交回复
热议问题