Creating an SQLite3 database file through Objective-C

后端 未结 6 1622
攒了一身酷
攒了一身酷 2020-12-01 15:19

I\'m trying to create an SQLite3 database file through Objective-C at run time. I am trying to create a table called \"tblStore\". I want the field names to be called \"st

6条回答
  •  攒了一身酷
    2020-12-01 16:10

    you can open terminal and cd to /Users/Matt**/Library/Application Support/iPhone Simulator/5.1/Applications/5DB7A218-A0F6-485F-B366-91FD2F9BC062/Documents/

    then sqlite3 tblStore.sqlite

    then use .schema tblStore should show your table schema and you can see if it was built correctly.

    Your database needs to be in the documents directory for write access. If your database was only going to be read, never written to it could be in your application bundle. One way to accomplishing this is to create your database.sqlite file and add it to the bundle and copy it to the documents directory (if it doesn't already exist there) on launch.

提交回复
热议问题