1.当我尝试在iPhone 5(iOS 8.1)上使用新版本升级我的应用程序时,它会崩溃并在日志中显示以下消息 2.但在iPad(iOS版本9.3)上,它已升级并正常工作。
2017-01-16 21:57:58.840 iMenu4u [199:7493] CoreData:错误: -addPersistentStoreWithType:SQLite配置:(null)URL:file:///var/mobile/Containers/Data/Application/33758D50-71B0-421E-BDEF-C4DE654833FC/Documents/Restaurant_App.sqlite 选项:{ NSInferMappingModelAutomaticallyOption = 1; NSMigratePersistentStoresAutomaticallyOption = 1; } ...返回错误错误Domain = NSCocoaErrorDomain Code = 134130"操作 无法完成。 (可可错误134130。)"的UserInfo = 0x186274e0 {URL =文件:///var/mobile/Containers/Data/Application/33758D50-71B0-421E-BDEF-C4DE654833FC/Documents/Restaurant_App.sqlite, 元数据= { NSPersistenceFrameworkVersion = 519; NSStoreModelVersionHashes = { AppConfigData =< 91e79eb3 93204ebc 5be5bdb3 38a8c76d f8457935 dde27339 2369b7cc adf2efaf&gt ;; AppState =< 3d103f0a 206bebf1 1ff42e06 3df5aa24 af2ebe63 945db1aa 5ea028fc 329bf545&gt ;; 评论=; 优惠券=< 29d647a0 5a02f9b7 3df7c9ae a6fe6256 5b5af073 df656cb5 8cb78bf5 acf22b37&gt ;; DelivaryAddress =< 42b0cf74 38afa03d 0c953a3c 23f9fd05 7184f8f2 53db68b1 6876631a 9c6564ee&gt ;; DeliveryChargeConfig =< 71044840 88917be5 5095afb1 e02dfff4 069187f4 56cc7a50 6e9c618a 45b07748&gt ;; FeedBackDB =< 8c689d34 6a5b5ef4 fc9b9930 ed346f2d 25bf2476 5862594e 32b9665f d115e376&gt ;; LocalSelectedOrderOption =; MenuCalendar =< 85af0738 a811d0a3 c2376b1c 097a665d 613c90bb 9ac8c5a7 da8439a0 6daadcd7&gt ;; MenuCategory =; MenuItem =; MenuOption =; 订单=; OrderDetails =; OrderOptions =; 人=; 餐厅=< 7073cb59 3ebc431f e0049cd8 a5e67106 8a3aec05 349dc497 7c701483 f552f153&gt ;; RestaurantBannerConfig =; RestaurantCalender =< 21efa3fa 3f1077fe 0b7c6db5 8b62caf3 ae46dbda 49ccf907 d048957a c3906d19&gt ;; RestaurantDeployment =< 690457a9 b8f49fdb 6b2ac3da af46784d 7fe43811 1fdd3d19 c57fa1ca e13c47b3&gt ;; RestroManagedObject =; SelectedRestaurantApiDetails =< 08ca5f45 59c0b51f 21f3eb1e e5857d6a a7569df2 2c201648 6baed0b2 082e785f&gt ;; }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers =( 19 ); NSStoreType = SQLite; NSStoreUUID =" BBBF21BB-E24D-45EE-A0EB-E59774B9D69B&#34 ;; " _NSAutoVacuumLevel" = 2; },reason =无法使用userInfo字典{找到源存储的模型} { URL =" file:///var/mobile/Containers/Data/Application/33758D50-71B0-421E-BDEF-C4DE654833FC/Documents/Restaurant_App.sqlite" ;; metadata = { NSPersistenceFrameworkVersion = 519; NSStoreModelVersionHashes = { AppConfigData =< 91e79eb3 93204ebc 5be5bdb3 38a8c76d f8457935 dde27339 2369b7cc adf2efaf&gt ;; AppState =< 3d103f0a 206bebf1 1ff42e06 3df5aa24 af2ebe63 945db1aa 5ea028fc 329bf545&gt ;; 评论=; 优惠券=< 29d647a0 5a02f9b7 3df7c9ae a6fe6256 5b5af073 df656cb5 8cb78bf5 acf22b37&gt ;; DelivaryAddress =< 42b0cf74 38afa03d 0c953a3c 23f9fd05 7184f8f2 53db68b1 6876631a 9c6564ee&gt ;; DeliveryChargeConfig =< 71044840 88917be5 5095afb1 e02dfff4 069187f4 56cc7a50 6e9c618a 45b07748&gt ;; FeedBackDB =< 8c689d34 6a5b5ef4 fc9b9930 ed346f2d 25bf2476 5862594e 32b9665f d115e376&gt ;; LocalSelectedOrderOption =; MenuCalendar =< 85af0738 a811d0a3 c2376b1c 097a665d 613c90bb 9ac8c5a7 da8439a0 6daadcd7&gt ;; MenuCategory =; MenuItem =; MenuOption =; 订单=; OrderDetails =; OrderOptions =; 人=; 餐厅=< 7073cb59 3ebc431f e0049cd8 a5e67106 8a3aec05 349dc497 7c701483 f552f153&gt ;; RestaurantBannerConfig =; RestaurantCalender =< 21efa3fa 3f1077fe 0b7c6db5 8b62caf3 ae46dbda 49ccf907 d048957a c3906d19&gt ;; RestaurantDeployment =< 690457a9 b8f49fdb 6b2ac3da af46784d 7fe43811 1fdd3d19 c57fa1ca e13c47b3&gt ;; RestroManagedObject =; SelectedRestaurantApiDetails =< 08ca5f45 59c0b51f 21f3eb1e e5857d6a a7569df2 2c201648 6baed0b2 082e785f&gt ;; }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers =( 19 ); NSStoreType = SQLite; NSStoreUUID =" BBBF21BB-E24D-45EE-A0EB-E59774B9D69B&#34 ;; " _NSAutoVacuumLevel" = 2; }; reason ="无法找到源存储的模型&#34 ;; }
2017-01-16 21:57:58.848 iMenu4u [199:7493] CoreData:注释: NSPersistentStoreCoordinator的当前模型哈希是{ AppConfigData =< 91e79eb3 93204ebc 5be5bdb3 38a8c76d f8457935 dde27339 2369b7cc adf2efaf&gt ;; AppState =< 3d103f0a 206bebf1 1ff42e06 3df5aa24 af2ebe63 945db1aa 5ea028fc 329bf545&gt ;; 评论=; 优惠券=< 29d647a0 5a02f9b7 3df7c9ae a6fe6256 5b5af073 df656cb5 8cb78bf5 acf22b37&gt ;; DelivaryAddress =< 42b0cf74 38afa03d 0c953a3c 23f9fd05 7184f8f2 53db68b1 6876631a 9c6564ee&gt ;; DeliveryChargeConfig =< 71044840 88917be5 5095afb1 e02dfff4 069187f4 56cc7a50 6e9c618a 45b07748&gt ;; FeedBackDB =< 8c689d34 6a5b5ef4 fc9b9930 ed346f2d 25bf2476 5862594e 32b9665f d115e376&gt ;; LocalSelectedOrderOption =; MenuCalendar =< 85af0738 a811d0a3 c2376b1c 097a665d 613c90bb 9ac8c5a7 da8439a0 6daadcd7&gt ;; MenuCategory =< 5add7c9f bd0522f0 b3588e63 a37806a9 2ac6a571 234d5f87 48fe0a76 6bcde5e2&gt ;; MenuItem =< 8cea8408 9f264fcd e048a6e7 2991b43b a164f420 08b6534c 90f12e29 19fb5c25&gt ;; MenuOption =; 订单=; OrderDetails =; OrderOptions =; 人=; 餐厅=< 7073cb59 3ebc431f e0049cd8 a5e67106 8a3aec05 349dc497 7c701483 f552f153&gt ;; RestaurantBannerConfig =; RestaurantCalender =< 21efa3fa 3f1077fe 0b7c6db5 8b62caf3 ae46dbda 49ccf907 d048957a c3906d19&gt ;; RestaurantDeployment =< 690457a9 b8f49fdb 6b2ac3da af46784d 7fe43811 1fdd3d19 c57fa1ca e13c47b3&gt ;; RestroManagedObject =; SelectedRestaurantApiDetails =< 08ca5f45 59c0b51f 21f3eb1e e5857d6a a7569df2 2c201648 6baed0b2 082e785f&gt ;; }
答案 0 :(得分:0)
我认为您需要在项目中显式创建新版本的架构,以便iOS可以比较应用程序包中的两个架构并执行轻量级迁移。
从iOS 9开始,Core Data存储将当前架构与(sqlite)数据文件一起存储,这样,如果/当您更改应用程序包中的架构时,它可以执行在捕获的架构之间的轻量级迁移磁盘和应用包中的新架构。
此处的Google搜索结果可能对您有帮助...... http://www.informit.com/articles/article.aspx?p=2150667&seqNum=2
答案 1 :(得分:0)
我发现我的新应用版本存在问题。问题是,在新的应用版本中,我在“旧模型版本”中添加了一个列,然后执行了向“新模型版本”的迁移。 我现在纠正了。