Thursday, January 14, 2010

Working with SQL Databases on iPhone

I'm using a small sqlite database for my iPhone app and was having problems with the data. I was making changes to the database in either CLI or in Firefox SQLite Manager, deleting the database file from my iPhone project, and copying the new file in. It would never use the new data, only the old data was being accessed. I finally figured out what was going on because there was not enough rows when I was stepping through it and set out looking for an answer. Below is the first hit I found and it answered it perfectly.

Short answer: It get's cached like data for a normal application. Go look in your folder for the iPhone Simulator/USR/Applications and you will be able to delete it from there. Then compile your code again and it should be working.

No comments: