在CoreData中添加新实体时,“表ZSEARCH已存在”

时间:2019-01-25 04:02:42

标签: ios xcode sqlite core-data database-migration

我在CoreData中添加了一个新实体“ SEARCH”,并升级了.xcdatamodel文件。它适用于全新安装,但当我在旧版本上更新应用程序时崩溃。我使用了轻量级迁移。

以下错误是导致崩溃的原因:

错误:-addPersistentStoreWithType:SQLite配置:(null)URL:file:/// Users / xyz / Library / Developer / CoreSimulator / Devices / 38853F31-A533-4926-B7C9-7CF839FA5189 / data / Containers / Data / Application /7BC2C7F8-94AF-434E-BB25-80A46CCA5614/Library/Application%20Support/myApp.sqlite选项:{     NSInferMappingModelAutomaticallyOption = 1;     NSMigratePersistentStoresAutomaticallyOption = 1; } .. NSUnderlyingError =“错误域= NSCocoaErrorDomain代码= 134110 \”(空)\“ UserInfo = {NSSQLiteErrorDomain = 1,NSFilePath = / Users / xyz / Library / Developer / CoreSimulator / Devices / 38853F31-A533-4926-B7C9- 7CF839FA5189 /数据/容器/数据/应用程序/ 7BC2C7F8-94AF-434E-BB25-80A46CCA5614 / Library / Application Support / myApp.sqlite,NSUnderlyingException = / Users / xyz / Library / Developer / CoreSimulator / Devices中数据库的I / O错误/ 38853F31-A533-4926-B7C9-7CF839FA5189 / data / Containers / Data / Application / 7BC2C7F8-94AF-434E-BB25-80A46CCA5614 / Library / Application Support / myApp.sqlite.SQLite错误代码:1,“表ZSEARCH已存在” ,原因= / Users / xyz / Library / Developer / CoreSimulator / Devices / 38853F31-A533-4926-B7C9-7CF839FA5189 / data / Containers / Data / Application / 7BC2C7F8-94AF-434E-BB25-80A46CCA5614上的数据库的I / O错误/ Library / Application Support /myApp.sqlite。SQLite错误代码:1,'表ZSEARCH已存在'}“;     destinationURL =“ file:/// Users / xyz / Library / Developer / CoreSimulator / Devices / 38853F31-A533-4926-B7C9-7CF839FA5189 / data / Containers / Data / Application / 7BC2C7F8-94AF-434E-BB25-80A46CCA5614 / Library / Application%20Support / myApp.sqlite”;     原因=“无法迁移就地存储:/ Users / xyz / Library / Developer / CoreSimulator / Devices / 38853F31-A533-4926-B7C9-7CF839FA5189 / data / Containers / Data / Application / 7BC2C7F8- 94AF-434E-BB25-80A46CCA5614 / Library / Application Support /myApp.sqlite。SQLite错误代码:1,'表ZSEARCH已存在'';     sourceURL =“ file:/// Users / xyz / Library / Developer / CoreSimulator / Devices / 38853F31-A533-4926-B7C9-7CF839FA5189 / data / Containers / Data / Application / 7BC2C7F8-94AF-434E-BB25-80A46CCA5614 / Library / Application%20Support / myApp.sqlite”; }

我尝试了许多解决方案,但没有成功。请让我知道这里的内容吗?

0 个答案:

没有答案