gpt4 book ai didi

ios - 无法从 Xcode 崩溃日志确定崩溃原因

转载 作者:可可西里 更新时间:2023-11-01 04:56:42 25 4
gpt4 key购买 nike

我有一个用户在他的 iPhone 5 上运行我的应用程序。他使用 iTunes 执行了备份。买了一部新的 iPhone 6S 并从他的 iTunes 备份中恢复。

当他启动我的应用程序时,应用程序在启动过程中立即崩溃。我从他那里得到了崩溃日志,但没有错误信息。它在我的 AppDelegate 中自动生成的 -applicationDocumentsDirectory 函数期间崩溃。

- (NSURL *)applicationDocumentsDirectory
{
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}

有什么方法可以让我确定到底出了什么问题,看看我是否可以解决这个问题?

Incident Identifier: 3A0D56CA-EEAF-4F5A-8D16-D182E61034D5
CrashReporter Key: 9f4ce42b70e98d925f135c618394817f9451767b
Hardware Model: iPhone8,1
Process: MyApp [1198]
Path: /private/var/mobile/Containers/Bundle/Application/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX/MyApp.app/MyApp
Identifier: com.inadaydevelopment.myapp
Version: 1.0.1 (1.0)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]

Date/Time: 2015-10-02 14:30:25.25 -0700
Launch Time: 2015-10-02 14:30:25.25 -0700
OS Version: iOS 9.0.1 (13A405)
Report Version: 105

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0

Filtered syslog:
None found

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019950b1e0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001995d4f0c pthread_kill + 112
2 libsystem_c.dylib 0x000000019947eb78 abort + 140
3 MyApp 0x000000010001ef7c -[AppDelegate applicationDocumentsDirectory] (AppDelegate.m:517)
4 MyApp 0x000000010001eae8 -[AppDelegate managedObjectContext] (AppDelegate.m:430)
5 MyApp 0x000000010002d004 -[BaseViewController awakeFromNib] (BaseViewController.m:54)
6 UIKit 0x00000001890e6058 -[UINib instantiateWithOwner:options:] + 2188
7 UIKit 0x0000000189324ea0 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 196
8 UIKit 0x0000000189325000 -[UIStoryboard instantiateInitialViewController] + 68
9 UIKit 0x0000000188edd178 -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 108
10 UIKit 0x0000000188caee40 -[UIApplication _loadMainInterfaceFile] + 264
11 UIKit 0x0000000188edc068 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1316
12 UIKit 0x0000000188ed9300 -[UIApplication workspaceDidEndTransaction:] + 168
13 FrontBoardServices 0x000000018d7737ec -[FBSSerialQueue _performNext] + 184
14 FrontBoardServices 0x000000018d773b6c -[FBSSerialQueue _performNextFromRunLoopSource] + 56
15 CoreFoundation 0x000000018369c5a4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
16 CoreFoundation 0x000000018369c038 __CFRunLoopDoSources0 + 540
17 CoreFoundation 0x0000000183699d38 __CFRunLoopRun + 724
18 CoreFoundation 0x00000001835c8dc0 CFRunLoopRunSpecific + 384
19 UIKit 0x0000000188ca80c8 -[UIApplication _run] + 460
20 UIKit 0x0000000188ca2f60 UIApplicationMain + 204
21 MyApp 0x000000010001bdd0 main (main.m:16)
22 libdyld.dylib 0x00000001993ee8b8 start + 4

最佳答案

当将消息发送到已释放的实例时,经常会发生没有任何有用堆栈跟踪的崩溃。几周前,我在处理 UIViewController 类别时遇到了这个问题。

当然,你是对的,发送给 nil 的消息不会造成任何伤害。另一方面,发送到某个已释放实例的消息会导致崩溃。
尝试打开 ZombieObjects,然后您将在发生这种情况时获得日志,这可以帮助您找到错误。

关于ios - 无法从 Xcode 崩溃日志确定崩溃原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33000753/

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