示例:我有一个持久存储协调器,它使用一个持久存储。
现在有两个托管对象上下文,并且都希望使用相同的持久存储。两者都可以简单地使用相同的持久存储协调器,还是我必须创建 NSPersistentStoreCoordinator 的两个实例?如果必须这样做,那么:我是否还必须创建两个 NSPercientStore 实例?
最佳答案
Core Data on iPhone关于 ADC 的文章很好地介绍了这个主题:
In any application, you might have multiple managed object contexts. You might want to maintain discrete sets of managed objects and edits to those objects; or you might want to perform a background operation using one context while allowing the user to interact with objects in another. Each of these would be connected to the same coordinator.
持久存储协调器旨在处理多个上下文
关于iphone - 两个托管对象上下文可以共享一个持久存储协调器吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2989015/