SpokaneDude
SpokaneDude

Reputation: 4984

Why do I have extraneous objects in my Core Data object?

I have an app which uses Core Data. I have defined the Entities with their respective attributes several times. Now, I pretty much have it finalized, looking like this: enter image description here

I deleted the old sqlite d/b, re-ran the program which creates a new Sqlite d/b, and it looks like this (using SQLite Database Browser). The areas highlighted in yellow are the ones that don't belong there (IMHO)... how do I clear the old junk out of there when the Sqlite d/b is re-built from Core Data?

enter image description here

Upvotes: 0

Views: 61

Answers (1)

Lorenzo B
Lorenzo B

Reputation: 33428

The motivation is quite simple.

When you use entity inheritance, Core Data, under the hood, creates a (relational) table that has all the properties for the parent entity as well as its child (or children).

Although this feature is very useful, you should be aware of such a mechanism to avoid performance penalties.

Anyway, you should not work with the db created for you. You should think only in terms of object graph. You will simplify your life.

Hope that helps.

Upvotes: 1

Related Questions