gpt4 book ai didi

iphone - Core Data 的新手,在 persistentStoreCoordinator 中出错

转载 作者:行者123 更新时间:2023-11-29 11:21:32 25 4
gpt4 key购买 nike

我刚刚开始学习使用 Core Data。在我第一次尝试将对象添加到数据库时,我收到了以下信息:

2011-08-03 15:21:32.519 StuffNearMe[45040:15503] Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x81f03d0 {metadata=<CFBasicHash 0x81efed0 [0x1608ba8]>{type = immutable dict, count = 7,
entries =>
2 : <CFString 0x81ef8f0 [0x1608ba8]>{contents = "NSStoreModelVersionIdentifiers"} = <CFArray 0x81efa00 [0x1608ba8]>{type = immutable, count = 1, values = (
0 : <CFData 0x81ef9d0 [0x1608ba8]>{length = 0, capacity = 0, bytes = 0x}
)}
4 : <CFString 0x81ef920 [0x1608ba8]>{contents = "NSPersistenceFrameworkVersion"} = <CFNumber 0x81efa20 [0x1608ba8]>{value = +363, type = kCFNumberSInt64Type}
6 : <CFString 0x81ef950 [0x1608ba8]>{contents = "NSStoreModelVersionHashes"} = <CFBasicHash 0x81eff50 [0x1608ba8]>{type = immutable dict, count = 2,
entries =>
1 : <CFString 0x81efa30 [0x1608ba8]>{contents = "FavoriteAddress"} = <CFData 0x81efa70 [0x1608ba8]>{length = 32, capacity = 32, bytes = 0x0716904fb7c1b83554338231858021ed ... a0b76e5dbab42a40}
2 : <CFString 0x81efa50 [0x1608ba8]>{contents = "RecentAddress"} = <CFData 0x81eff00 [0x1608ba8]>{length = 32, capacity = 32, bytes = 0x9406126d6ea281dc3e96eed795fc67d8 ... 176c5845b46ca895}
}

7 : <CFString 0x11a7b18 [0x1608ba8]>{contents = "NSStoreUUID"} = <CFString 0x81efc80 [0x1608ba8]>{contents = "D4569F82-247B-4D4E-99DA-990570C0E6B5"}
8 : <CFString 0x11a7988 [0x1608ba8]>{contents = "NSStoreType"} = <CFString 0x11a7998 [0x1608ba8]>{contents = "SQLite"}
9 : <CFString 0x81ef980 [0x1608ba8]>{contents = "_NSAutoVacuumLevel"} = <CFString 0x81effa0 [0x1608ba8]>{contents = "2"}
10 : <CFString 0x81ef9a0 [0x1608ba8]>{contents = "NSStoreModelVersionHashesVersion"} = <CFNumber 0x813f720 [0x1608ba8]>{value = +3, type = kCFNumberSInt32Type}
}
, reason=The model used to open the store is incompatible with the one used to create the store}, {
metadata = {
NSPersistenceFrameworkVersion = 363;
NSStoreModelVersionHashes = {
FavoriteAddress = <0716904f b7c1b835 54338231 858021ed a81f0bb5 c0dc6347 a0b76e5d bab42a40>;
RecentAddress = <9406126d 6ea281dc 3e96eed7 95fc67d8 728976d1 92a0b26a 176c5845 b46ca895>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
<>
);
NSStoreType = SQLite;
NSStoreUUID = "D4569F82-247B-4D4E-99DA-990570C0E6B5";
"_NSAutoVacuumLevel" = 2;
};
reason = "The model used to open the store is incompatible with the one used to create the store";
}

如有任何帮助或建议,我们将不胜感激!当您第一次开始使用 Core Data 时,它是如此令人困惑。

最佳答案

错误是:

The model used to open the store is incompatible with the one used to create the store

这可能是因为您在首次创建模型后更改了它。如果您需要在创建架构后更改架构,请查看 Core Data Model Versioning and Data Migration Programming Guide .

关于iphone - Core Data 的新手,在 persistentStoreCoordinator 中出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6932107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com