【发布时间】:2017-03-07 05:13:05
【问题描述】:
我们将应用更新到了新版本。
新版本中添加了一个新函数,我们为该函数添加了一个新的 coredata 表。
应用程序发布后,错误继续没有答案。 有人会遇到同样的错误或同样的问题并解决这个错误吗?
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018981f014 __pthread_kill + 8
1 libsystem_c.dylib 0x0000000189793400 abort + 140
2 [AppName] 0x00000001002d0c58 AppDelegate.(persistentStoreCoordinator.getter).(closure #1) (AppDelegate.swift:318)
3 [AppName] 0x00000001002c7dec AppDelegate.persistentStoreCoordinator.getter (AppDelegate.swift:334)
4 [AppName] 0x00000001002d0cbc AppDelegate.(managedObjectContext.getter).(closure #1) (AppDelegate.swift:338)
5 [AppName] 0x00000001002c8054 AppDelegate.managedObjectContext.getter (AppDelegate.swift:342)
6 [AppName] 0x00000001002c8198 AppDelegate.saveContext() (AppDelegate.swift:347)
7 [AppName] 0x00000001002c7780 AppDelegate.applicationWillTerminate() (AppDelegate.swift:295)
8 [AppName] 0x00000001002c77d8 @objc AppDelegate.applicationWillTerminate() (AppDelegate.swift:0)
9 UIKit 0x0000000190792704 <redacted> + 244
10 UIKit 0x00000001909947cc <redacted> + 792
11 UIKit 0x0000000190997fdc <redacted> + 292
12 UIKit 0x0000000190989d50 <redacted> + 560
13 UIKit 0x00000001906f90b4 <redacted> + 168
14 CoreFoundation 0x000000018a7fe0c0 <redacted> + 32
15 CoreFoundation 0x000000018a7fbcf0 <redacted> + 372
16 CoreFoundation 0x000000018a7fc180 <redacted> + 1024
17 CoreFoundation 0x000000018a72a2b8 CFRunLoopRunSpecific + 444
18 GraphicsServices 0x000000018c1de198 GSEventRunModal + 180
19 UIKit 0x00000001907717fc <redacted> + 684
20 UIKit 0x000000019076c534 UIApplicationMain + 208
21 [AppName] 0x00000001002d1a94 main (AppDelegate.swift:17)
22 ??? 0x000000018970d5b8 0x0 + 0
【问题讨论】:
-
添加新字段,Core Data 中的实体会使您之前的 Core 数据模型失效,这可能会导致崩溃。如果您删除应用程序并重新安装它应该可以工作。
-
该堆栈跟踪显示应用程序在尝试保存更改时崩溃。没有其他有用的信息。这是您唯一一次尝试保存更改吗?如果您在其他时间保存会发生什么?除了堆栈跟踪之外,您还会收到哪些错误消息?