Trying to overwrite sqlite database in iPhone app update

后端 未结 1 1987
忘掉有多难
忘掉有多难 2021-01-03 13:29

Unlike most sqlite apps where developers don\'t want to overwrite data in a sqlite database, I\'m trying to enable an app to overwrite all data with future updates. The sql

相关标签:
1条回答
  • 2021-01-03 13:39

    A SQLite database file is just a normal file, so no special steps are needed. Get the path or URL to the file, and use NSFileManager's -removeItemAtPath:error: or -removeItemAtURL:error:. Then create the new database the same way you created the old one.

    0 讨论(0)
提交回复
热议问题