views:

21

answers:

1

Still beavering away, slowly sorting out how things work. Today I've been looking at persistent stores and managed objects. I think I understand the basics of it all, but I've noticed something odd. When I save my managed object context and open up the resulting sqlite file in an editor, there are three tables there I don't expect. They're named after objects that I was originally using as managed objects, but later altered so that they weren't any more. I have no idea why they've been retained, since I've completely changed my file saving structure since then. No data gets put into these tables, but they keep cropping up. Is there any way I can remove them, or are they being added for some purpose I'm unaware of?

-Ash

A: 

Right, I have finally worked out where the extra tables were coming from, but it's a little bit weird.

Basically, I had tested a previous version of the application on OS3.2 to ensure backward compatibility. I later changed the format of the database, but by then I had moved to testing on OS4 exclusively. Somehow, the program was checking the SQLite files in both the 4.0 and the 3.2 directories and combining them into one big table. The extra tables were also responsible for causing errors when I tried to upload a desktop version of the database to my device, because the device's own version of the tables had a slightly different format thanks to the unwanted tables not being on there.

So the moral of this story folks is, always delete your program files from the simulator when you want to test for problems on a different OS.

-Ash

Ash