所以我决定为我的一个实体创建 2 个子实体。
为了测试,我创建了这两个实体,没有任何属性,也没有关系。
如果我使用推断映射模型,核心数据会失败并且应用程序会崩溃。在这里报道
如果我创建映射模型,核心数据也无法升级。我检查了核心数据日志,它说实体哈希是正确的。这里有什么问题?
CoreData: annotation: Incompatible version schema for persistent store
'file://localhost/Users/.../StoreContent/persistentStore'.
store metadata = {
NSPersistenceFrameworkVersion = 419;
NSStoreModelVersionHashes = {
Chat = <05d870d5 8d51e966 51a6b121 56fd0eff 6a35760e 829245ce 38e82724 b511b400>;
Contact = <7f14d6ac 1bf1035e 63208d38 c048c396 d6385a95 3c8aec0b 36fbb86f 293fdb4d>;
Message = <45852277 e01bffe5 a83f71fe 09c20dba 838bb51c 411dc185 56ba4ff1 7b68ba3d>;
User = <1400bc94 f742db62 91627ea5 883e54a8 104da454 a9a7b073 f1e827ad 26f7e7c8>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
3July13
);
NSStoreType = SQLite;
NSStoreUUID = "73F77A17-9720-4D0E-90DD-D07A0EAECB29";
"_NSAutoVacuumLevel" = 2; } and current model versions = {
Broadcast = <e2afd25a 758f8e8b 7a2e1f2d 03042e32 e5e23693 a4935257 04a8e9fb 535e2452>;
Chat = <05d870d5 8d51e966 51a6b121 56fd0eff 6a35760e 829245ce 38e82724 b511b400>;
Contact = <7f14d6ac 1bf1035e 63208d38 c048c396 d6385a95 3c8aec0b 36fbb86f 293fdb4d>;
Group = <67fa7527 b68ea99d ee8e704f 30f20e48 58350963 73e29c19 8aea7604 dfac7d7c>;
Message = <45852277 e01bffe5 a83f71fe 09c20dba 838bb51c 411dc185 56ba4ff1 7b68ba3d>;
User = <1400bc94 f742db62 91627ea5 883e54a8 104da454 a9a7b073 f1e827ad 26f7e7c8>; }
2013-07-04 10:25:53.678 JonglaIM[90118:22103]
CoreData: annotation: (migration) will attempt automatic schema
migration 2013-07-04 10:25:55.209 x[90118:22103] CoreData:
annotation: (migration) looking for mapping model with source
hashes: {
Chat = <05d870d5 8d51e966 51a6b121 56fd0eff 6a35760e 829245ce 38e82724 b511b400>;
Contact = <7f14d6ac 1bf1035e 63208d38 c048c396 d6385a95 3c8aec0b 36fbb86f 293fdb4d>;
Message = <45852277 e01bffe5 a83f71fe 09c20dba 838bb51c 411dc185 56ba4ff1 7b68ba3d>;
User = <1400bc94 f742db62 91627ea5 883e54a8 104da454 a9a7b073 f1e827ad 26f7e7c8>; }
destination hashes: {
Broadcast = <e2afd25a 758f8e8b 7a2e1f2d 03042e32 e5e23693 a4935257 04a8e9fb 535e2452>;
Chat = <05d870d5 8d51e966 51a6b121 56fd0eff 6a35760e 829245ce 38e82724 b511b400>;
Contact = <7f14d6ac 1bf1035e 63208d38 c048c396 d6385a95 3c8aec0b 36fbb86f 293fdb4d>;
Group = <67fa7527 b68ea99d ee8e704f 30f20e48 58350963 73e29c19 8aea7604 dfac7d7c>;
Message = <45852277 e01bffe5 a83f71fe 09c20dba 838bb51c 411dc185 56ba4ff1 7b68ba3d>;
User = <1400bc94 f742db62 91627ea5 883e54a8 104da454 a9a7b073 f1e827ad 26f7e7c8>; }
2013-07-04 10:25:55.214 x[90118:22103]
CoreData: annotation: (migration) checking mapping model at path
file://localhost/Users/.../Model.cdm
source hashes: {(
<1400bc94 f742db62 91627ea5 883e54a8 104da454 a9a7b073 f1e827ad 26f7e7c8>,
<7f14d6ac 1bf1035e 63208d38 c048c396 d6385a95 3c8aec0b 36fbb86f 293fdb4d>,
<05d870d5 8d51e966 51a6b121 56fd0eff 6a35760e 829245ce 38e82724 b511b400>,
<45852277 e01bffe5 a83f71fe 09c20dba 838bb51c 411dc185 56ba4ff1 7b68ba3d> )}
destination hashes: {(
<e2afd25a 758f8e8b 7a2e1f2d 03042e32 e5e23693 a4935257 04a8e9fb 535e2452>,
<1400bc94 f742db62 91627ea5 883e54a8 104da454 a9a7b073 f1e827ad 26f7e7c8>,
<7f14d6ac 1bf1035e 63208d38 c048c396 d6385a95 3c8aec0b 36fbb86f 293fdb4d>,
<67fa7527 b68ea99d ee8e704f 30f20e48 58350963 73e29c19 8aea7604 dfac7d7c>,
<05d870d5 8d51e966 51a6b121 56fd0eff 6a35760e 829245ce 38e82724 b511b400>,
<45852277 e01bffe5 a83f71fe 09c20dba 838bb51c 411dc185 56ba4ff1 7b68ba3d> )} 2013-07-04 10:25:55.215 x[90118:22103] CoreData:
annotation: (migration) no suitable mapping model found