Objective c 如何检测哪个线程及其崩溃的位置?

Objective c 如何检测哪个线程及其崩溃的位置?,objective-c,cocoa-touch,Objective C,Cocoa Touch,Im使用的是用于iOS的XMPP框架,它有时会崩溃。无论何时我调试它都不会崩溃,它总是在我运行应用程序时发生 所以我想知道如何检测这是在哪里发生的 这是发生时我收到的错误消息 [Switching to thread 20483] [Switching to thread 20483] (gdb) continue [Switching to thread 11523] [Switching to thread 11523] 2011-11-18 16:37:45.301 [559:9e0b]

Im使用的是用于iOS的XMPP框架,它有时会崩溃。无论何时我调试它都不会崩溃,它总是在我运行应用程序时发生

所以我想知道如何检测这是在哪里发生的

这是发生时我收到的错误消息

[Switching to thread 20483]
[Switching to thread 20483]
(gdb) continue
[Switching to thread 11523]
[Switching to thread 11523]
2011-11-18 16:37:45.301 [559:9e0b] bool _WebTryThreadLock(bool), 0x2e2710: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...
[Switching to thread 20483]
[Switching to thread 20483]
Program received signal:  “EXC_BAD_ACCESS”.
kill
quit

我以前得到过更多这样的东西,但我能够检测到它们,但这次没有…

您可以尝试在“项目窗口”下的菜单中使用“管理器”,控制台显示正在发生的情况。

您还可以启用所谓的僵尸来帮助跟踪此类错误。对于僵尸,如果您解除分配对象,您的对象不会完全解除分配,因此当您引用“不存在”的对象时,它实际上仍然存在。 通常,您可以看到导致EXC\u BAD\u访问的确切代码行