preloaded sqlite3 db read only on iphone5

I am using a preloaded sqlite3 db for my app. the app works fine on simulator. But after I deploy the app to iPhone 5 I found that the database is read only on iphone5, so i cannot update/insert data with error code 8 (read only).

Any idea/solution?

Thanks

Yiguang

You have to copy it (once) to the documents folder and then use the copy.  You can’t write to the one stored in the ‘ResourceDirectory’.  That is a read-only area.

Thank you very much. It works!

You have to copy it (once) to the documents folder and then use the copy.  You can’t write to the one stored in the ‘ResourceDirectory’.  That is a read-only area.

Thank you very much. It works!