Why might I want 2 or more Core Data models?

前端 未结 2 926

I am curious to know who uses multiple core data models and why, what are the benefits, I am developing an application which I think I could benefit from multiple models, but I\

2条回答
  •  眼角桃花
    2021-02-14 13:01

    I'd recommend using just 1 core data model. If you separate them, you won't be able to use a lot of the features of Core Data, such as relationships (between objects in the data store) etc. Even if you don't see the need right now, you may come up with an idea to add to the app later that needs it.

    You could still use the same core data model for both iPad and iPhone, just ignore the parts you're not using the iPhone (until you get feature requests to add the missing parts, which you very likely will). Then you'll be all set and already have the data available.

    Only in extreme cases would it be worth using a separate data model, for example, if you were going to download an existing data set that was read only etc. You might separate the read only data set from the users settings/data etc.

    Good luck with the app!

提交回复
热议问题