beachdog
Sep 8, 2008, 09:32 AM
I have a couple of questions related to using a SQLite database. I have a fairly large SQL database that is part of my app, and I will be allowing the user to modify the data in the database. I have studied the SQLiteBooks sample, and I noticed that in that example they make a copy of the database that is provided with the app, which the code comments indicate is needed because if the database packaged with the application were to be modified it would cause a code signing problem. I have followed the same pattern in my application, but have some questions:
1) Since my database is fairly large, it seems like a waste of space for the device to end up with two copies of the database -- the "read only" copy that is part of the application bundle, and the actual "read write" copy that they application actually uses, which is copied into the Documents directory. Is there an alternative that is more efficient from the standpoint of storage usage?
2) The sample code creates the "read-write" copy if it doesn't exist. However, in my testing I frequently need to make changes to the DB schema and then retest. However, my code sees that the database already exists and therefore does not copy over the modified schema. And if I modify the code to copy it over anyways I get a "file exists" error. How do I get around this?
3) Problem #2 above led me to think that what I need to be able to do during testing is wipe the old application and any and all data off my device from time to time during testing, but then I realized I did not know how to do that. How can I delete an application from my device that I did not download from iTunes but rather installed via Xcode for testing?
Thanks in advance...
1) Since my database is fairly large, it seems like a waste of space for the device to end up with two copies of the database -- the "read only" copy that is part of the application bundle, and the actual "read write" copy that they application actually uses, which is copied into the Documents directory. Is there an alternative that is more efficient from the standpoint of storage usage?
2) The sample code creates the "read-write" copy if it doesn't exist. However, in my testing I frequently need to make changes to the DB schema and then retest. However, my code sees that the database already exists and therefore does not copy over the modified schema. And if I modify the code to copy it over anyways I get a "file exists" error. How do I get around this?
3) Problem #2 above led me to think that what I need to be able to do during testing is wipe the old application and any and all data off my device from time to time during testing, but then I realized I did not know how to do that. How can I delete an application from my device that I did not download from iTunes but rather installed via Xcode for testing?
Thanks in advance...
