gpt4 book ai didi

ios - 应用 SIGABRT 崩溃

转载 作者:行者123 更新时间:2023-12-02 17:51:44 24 4
gpt4 key购买 nike

当我在 Xcode 中运行我的 iOS 应用程序并在我的设备上测试它(提交之前)时,它不会返回任何错误,并且运行完美。但是,当我在更新到应用程序商店后测试该应用程序时,每次我在设备上打开该应用程序时,它都会崩溃。我在崩溃日志中收到以下错误:

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x2f9ecf06 __exceptionPreprocess + 126
1 libobjc.A.dylib 0x3a183ce2 objc_exception_throw + 34
2 CoreData 0x2f72a694 -[NSPersistentStoreCoordinator initWithManagedObjectModel:] + 392
3 TapNotes 0x00015d3c -[AppDelegate persistentStoreCoordinator] (AppDelegate.m:104)
4 TapNotes 0x00015b48 -[AppDelegate managedObjectContext] (AppDelegate.m:73)
5 TapNotes 0x00016904 -[DeviceViewController managedObjectContext] (HomeViewController.m:22)
6 TapNotes 0x00016b04 -[DeviceViewController viewDidAppear:] (HomeViewController.m:51)
7 UIKit 0x32236d1e -[UIViewController _setViewAppearState:isAnimating:] + 434
8 UIKit 0x322e6052 -[UINavigationController viewDidAppear:] + 178
9 UIKit 0x32236d1e -[UIViewController _setViewAppearState:isAnimating:] + 434
10 UIKit 0x3229be7a -[UIViewController _executeAfterAppearanceBlock] + 50
11 UIKit 0x3229be04 _applyBlockToCFArrayCopiedToStack + 312
12 UIKit 0x32214b6e _afterCACommitHandler + 454
13 CoreFoundation 0x2f9b8034 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
14 CoreFoundation 0x2f9b59c2 __CFRunLoopDoObservers + 282
15 CoreFoundation 0x2f9b5d0e __CFRunLoopRun + 734
16 CoreFoundation 0x2f920764 CFRunLoopRunSpecific + 520
17 CoreFoundation 0x2f920546 CFRunLoopRunInMode + 102
18 GraphicsServices 0x3488d6ce GSEventRunModal + 134
19 UIKit 0x3227f88c UIApplicationMain + 1132
20 TapNotes 0x00016886 main (main.m:16)
21 libdyld.dylib 0x3a681ab2 tlv_initializer + 2


Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3a7381f0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x3a7a07b2 pthread_kill + 54
2 libsystem_c.dylib 0x3a6e8ff4 abort + 72
3 libc++abi.dylib 0x39b3798a abort_message + 70
4 libc++abi.dylib 0x39b506e2 default_terminate_handler() + 250
5 libobjc.A.dylib 0x3a183f7a _objc_terminate() + 190
6 libc++abi.dylib 0x39b4e1b0 std::__terminate(void (*)()) + 76
7 libc++abi.dylib 0x39b4dd12 __cxa_rethrow + 98
8 libobjc.A.dylib 0x3a183e2a objc_exception_rethrow + 38
9 CoreFoundation 0x2f9207da CFRunLoopRunSpecific + 638
10 CoreFoundation 0x2f920546 CFRunLoopRunInMode + 102
11 GraphicsServices 0x3488d6ce GSEventRunModal + 134
12 UIKit 0x3227f88c UIApplicationMain + 1132
13 TapNotes 0x00016886 main (main.m:16)
14 libdyld.dylib 0x3a681ab4 start + 0

Thread 1:
0 libsystem_kernel.dylib 0x3a725804 kevent64 + 24
1 libdispatch.dylib 0x3a674050 _dispatch_mgr_invoke + 228
2 libdispatch.dylib 0x3a66e2de _dispatch_mgr_thread + 34

Thread 2:
0 libsystem_kernel.dylib 0x3a738c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a79dc1e _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a79dad8 start_wqthread + 4

Thread 3:
0 libsystem_kernel.dylib 0x3a738c70 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x3a79dc1e _pthread_wqthread + 306
2 libsystem_pthread.dylib 0x3a79dad8 start_wqthread + 4

Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00002060
r4: 0x00000006 r5: 0x3c69418c r6: 0x00000000 r7: 0x27df2594
r8: 0x17e8d090 r9: 0x00000001 r10: 0x0000000c r11: 0x00000002
ip: 0x00000148 sp: 0x27df2588 lr: 0x3a7a07b7 pc: 0x3a7381f0
cpsr: 0x00000010

我尝试在多个设备上打开,但出现了同样的情况。我应该怎么做才能解决这个问题?

最佳答案

从日志的外观来看,您的代码中可能有默认的Core Data堆栈,并且在更新中修改了您的对象模型。然后,您会遇到版本更新迁移问题。在 Core Data 模板中,有一个很好的调用 abort()

- (NSPersistentStoreCoordinator *)persistentStoreCoordinator

方法。有一个很好的长评论关于它不应该出现在生产代码中以及一些关于迁移的想法。我会查看该方法并验证 abort() 是否已消失。

关于ios - 应用 SIGABRT 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23554332/

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