【发布时间】:2016-12-27 11:19:49
【问题描述】:
我有一个核心数据模型,它向实体添加了一个属性。它迁移得很好,我可以毫无问题地向该实体添加新对象。当我尝试向不同实体中的另一个对象添加新关系时,我收到了这个致命错误。
Unresolved error Error Domain=NSCocoaErrorDomain Code=134020 "The model configuration used to open the store is incompatible with the one that was used to create the store." UserInfo={problemObject=<Order: 0x1702a5a00> (entity: Order; id: 0x170431980 <x-coredata:///Order/t38B0CF1D-437E-44AE-B833-D10B5AD584535> ; data: {
collection = "0xd000000000040004 <x-coredata://D29044CF-B9FB-4D26-9FB3-96FFEE919BD0/Collection/p1>";
displayOrder = 9999;
filterUser = "0xd000000000100008 <x-coredata://22E973D7-62F3-4F8F-B85B-CF12DFB8EFD7/FilterUser/p4>";
quantity = 1;
size = 1;
}), NSUnderlyingException=Can't resolve how to assign objects to stores; some objects may have been assigned to stores; use [[managedObject objectID] persistentStore] to find out what is going where now; use [managedObjectContext assignObject:toStore:] to straighten things out}, [AnyHashable("problemObject"): <Order: 0x1702a5a00> (entity: Order; id: 0x170431980 <x-coredata:///Order/t38B0CF1D-437E-44AE-B833-D10B5AD5845
如果我向实体添加一个新对象,那么与它的关系就可以正常工作,实际上现有对象上的现有关系也可以工作,它只是新的。我这辈子都搞不清楚到底发生了什么。
【问题讨论】:
-
我应该补充一点,我有 2 个配置附加到不同的商店,但所有这些都在同一个配置/商店中。
标签: ios swift sqlite core-data