I have this weird problem where I lose my data after a crash.
What happens is the following:
I insert a product in the app -> product is saved to the sqlite database.
The app crashes. At this moment the product is still in the database (I double checked this on simulator and iphone device with ftp to get my sqlite database off my phone.)
At the moment of reinitiating my app, the contents of the sqlite are removed. And an empty sqlite with the same tables etc is replaced.
I wonder why and how to fix this problem.
Thanks in advance,
Lewion.
I presume on start-up you’re checking for the presence of the database in your document directory and copying a “clean” copy from your bundle if none is present.
Are you sure the problem doesn’t lie in the logic you’re using there?