datinc
datinc

Reputation: 3552

NSCoreData Base class

I am making an app and I would like to create a database where I can add notes to many of my different entities. To do this I made a base class and marked it as abstract. I then made a one-to-many relationship from my note entity to my base class. I then created numerous subclasses of my base class. Everything works perfectly. However I looked at the DB that was created and... I have one table for all my subclasses (I have lots). So I have two questions

  1. Am I doing it right?
  2. Does it matter performance wise if all my managed objects are stored in one table?

Upvotes: 0

Views: 267

Answers (2)

Anoop Vaidya
Anoop Vaidya

Reputation: 46533

Its a mapped class, bit similar but ofcourse differnt from ORM(Object Relational Model).

Its table are for internal use, you only deal with classes and objects.

No worry for its performance.

Upvotes: 0

Fogmeister
Fogmeister

Reputation: 77621

When you're using core data you shouldn't really pay too much attention to the tables created behind the scenes.

If the data model you have is correct then the fetches will work.

Upvotes: 1

Related Questions