gpt4 book ai didi

swift - xcdatamodeld 我必须填写所有属性吗

转载 作者:行者123 更新时间:2023-11-30 10:19:12 27 4
gpt4 key购买 nike

xcdatamodeld 我是否必须填写实体中的所有属性?每次我使用核心数据,尝试插入图像路径和字符串时,插入字符串时都会崩溃,请帮忙,错误如下。

returned error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x7fac334193f0 {metadata={
NSPersistenceFrameworkVersion = 519;
NSStoreModelVersionHashes = {
Entity = <e4d98363 c5118882 22f0534c 6b38c82e 013fbea8 b50048e4 337fa5ba dfebd41e>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "E509F0EC-384B-48BB-954F-81379074917B";
"_NSAutoVacuumLevel" = 2; }, reason=The model used to open the store is incompatible with the one used to create the store} with userInfo dictionary {
metadata = {
NSPersistenceFrameworkVersion = 519;
NSStoreModelVersionHashes = {
Entity = <e4d98363 c5118882 22f0534c 6b38c82e 013fbea8 b50048e4 337fa5ba dfebd41e>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "E509F0EC-384B-48BB-954F-81379074917B";
"_NSAutoVacuumLevel" = 2;
};
reason = "The model used to open the store is incompatible with the one used to create the store"; } 2015-02-01 22:35:05.476 test[17368:543208] Unresolved error Optional(Error Domain=YOUR_ERROR_DOMAIN Code=9999 "Failed to initialize the application's saved data" UserInfo=0x7fac3419d060 {NSLocalizedFailureReason=There was an error creating or loading the application's saved data., NSLocalizedDescription=Failed to initialize the application's saved data, NSUnderlyingError=0x7fac33419440 "The operation couldn’t be completed. (Cocoa error 134100.)"}), Optional([NSLocalizedFailureReason: There was an error creating or loading the application's saved data., NSLocalizedDescription: Failed to initialize the application's saved data, NSUnderlyingError: Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x7fac334193f0 {metadata={
NSPersistenceFrameworkVersion = 519;
NSStoreModelVersionHashes = {
Entity = <e4d98363 c5118882 22f0534c 6b38c82e 013fbea8 b50048e4 337fa5ba dfebd41e>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
""
);
NSStoreType = SQLite;
NSStoreUUID = "E509F0EC-384B-48BB-954F-81379074917B";
"_NSAutoVacuumLevel" = 2; }, reason=The model used to open the store is incompatible with the one used to create the store}])

最佳答案

您的错误是:用于开设商店的模型与用于创建商店的模型不兼容。当您更新核心数据模型时。 (通过添加新属性或新实体等),核心数据必须将旧数据“迁移”到新模型。

但简单的解决方案是删除应用程序(从模拟器或设备中)并在每次修改模型时再次运行它。

关于swift - xcdatamodeld 我必须填写所有属性吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28266996/

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