开发者

Unexpected tables appearing in my SQLite database

Still beavering away, slowly sorting out how things work. Today I've been looking at persistent stores a开发者_如何学编程nd 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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜