为什么使用Core Data的人希望在同一个托管对象模型中使用多个持久存储?

时间:2021-03-07 16:45:53

I'm pretty new to Core Data, and I'm trying to wrap my head around it.

我对核心数据很陌生,我正试图把我的注意力集中在它上面。

1 个解决方案

#1


8  

You might have cases where you want different types of data stored in different places or with different behaviors. For example you might have one read only sqlite store shipped as part of your app containing some default data, an additional store for updates to that data set you have downloaded from a server, and a third for user data. Alternately you might have a case where you want some objects to be persisted while others can live in an in-memory store and do not need to be saved between uses of the app.

您可能需要不同类型的数据存储在不同的位置或具有不同的行为。例如,您可能有一个只读sqlite store作为应用程序的一部分,其中包含一些默认数据,一个用于更新从服务器下载的数据集的额外存储,以及第三个用于用户数据。另一种情况是,您希望一些对象被持久化,而另一些对象可以存储在内存中,并且不需要在应用程序使用之间保存。

#1


8  

You might have cases where you want different types of data stored in different places or with different behaviors. For example you might have one read only sqlite store shipped as part of your app containing some default data, an additional store for updates to that data set you have downloaded from a server, and a third for user data. Alternately you might have a case where you want some objects to be persisted while others can live in an in-memory store and do not need to be saved between uses of the app.

您可能需要不同类型的数据存储在不同的位置或具有不同的行为。例如,您可能有一个只读sqlite store作为应用程序的一部分,其中包含一些默认数据,一个用于更新从服务器下载的数据集的额外存储,以及第三个用于用户数据。另一种情况是,您希望一些对象被持久化,而另一些对象可以存储在内存中,并且不需要在应用程序使用之间保存。