tags:

views:

28

answers:

3

Hi,

I am copying a SQLite file to the "Documents" directory of my iPhone/Simulator.

First I deleted the app off my phone and from the simulator and the app folder disappeared in "Application Support / iPhone " folder.

I made changes to the structure, deleted old version and copied new version to my "Resources" folder. Restarted my app which then copied the file back to the "Application Support / iPhone " fine.

The problem was though the file seemed to be cached as it would not execute queries on the new tables I added?

I have now fixed this by following the above steps BUT also renaming the database, but was wondering if anyone could shed some light on this?

Thanks James

A: 

When changing a ressource I always "clean all target" and delete my App from the iPhone (device or simulator) , so I'm sure it will make the change. However if your sqlite database is located in you ressources directory and not in document directory , you w'ont be able to do action such INSERT or ALTER TABLE because ressource directory is READ ONLY ;-) . I advise you to move your sqlite db in Document folder when the app launch ;-) .

Hope it will help you.

Human-Behind
A: 

Try a clean build. In Xcode: Build > Clean All Targets

esqew
This still did not work to get around this I named the database something else and then added that to the "Document" directory.
jodm
A: 

Had to renamed the files as Cleaning the targets did not seems to work.

jodm