Tag: 多数据库

CoreData与多个商店:configuration的困境

我有一个大型的,预加载的数据库和一个小型用户数据库(CoreData SQLite商店)的iOS项目。 先前的问题已经build议使用configuration来控制哪个实体与哪个商店一起使用。 我无法正常工作。 这是我一直在尝试… – (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) return _managedObjectModel; // set up the model for the preloaded data NSURL *itemURL = [[NSBundle mainBundle] URLForResource:@"FlagDB" withExtension:@"momd"]; NSManagedObjectModel *itemModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:itemURL]; // set up the model for the user data NSURL *userDataURL = [[NSBundle mainBundle] URLForResource:@"UserData" withExtension:@"momd"]; NSManagedObjectModel *userDataModel […]