sqlite prepare statement error - no such table

后端 未结 3 653
天命终不由人
天命终不由人 2021-01-14 19:45

I\'m having some difficulty with my sqlite prepare statement. I get an error saying my table does not exist, although I\'ve checked in multiple places for it, and it does ex

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-14 20:14

    I have encounter the same problem as yours. If the IOS can not find the designated database file, defaultly it will create one for you instead of throwing an error. So you must open the database file IOS created for you which is blank so it off course contain the table you expected. what I deal with it : 1 you have to bundle the resource file named *.sqlite3 into your project 2 Then You have to use [NSBundle mainBundle] pathFordirectory...... function to search your proper database file. then you can open the database file you expected and can operate it properly

    Best regards,

提交回复
热议问题