在Xcode / iPhone中堆栈跟踪或更多关于未处理异常的信息 [英] Stack trace or more info on unhandled exception in Xcode/iPhone

查看:103
本文介绍了在Xcode / iPhone中堆栈跟踪或更多关于未处理异常的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅我的无知,但在iPhone模拟器中运行iPhone应用程序时,有些事情一直困扰着Xcode调试器。

Excuse my ignorance, but something's been bugging me about the Xcode debugger when running iPhone applications in the iPhone Simulator.

有时候,当我在Interface Builder中弄乱了一些东西时,我在运行时得到一个未处理的异常,然后我被抛回Xcode。我唯一看到的是单行未捕获的异常或类似的东西。从我所看到的,没有其他信息,更不用说堆栈跟踪或其他任何有用的信息了。

Sometimes, when I mess something up in Interface Builder, I get an unhandled exception at runtime and I get thrown back to Xcode. The only thing I see is a single line "uncaught exception" or something like that. From what I can see, there's no additional information, let alone a stack trace or anything else that's useful.

过去十年左右我在Visual Studio中一直在开发,我习惯于获得一个很好的堆栈跟踪,并在发生这样的事情时完成异常信息。

I have been developing in Visual Studio for the last decade or so, and I'm used to getting a nice stack trace and complete exception info when something like that happens.

我确信我只是遗漏了一些非常明显的东西。 ..希望...

I'm sure I'm simply missing something very obvious... Hopefully...

推荐答案

如果添加两个断点,则应该能够调试这些异常。为此,请转到运行|显示|断点并创建两个全局断点(我在全局中断点,因为它们在我的所有应用程序中都非常有用)。第一个应命名为objc_exception_throw,其位置应为libobjc.A.dylib。第二个应该是 - [NSException raise],它的位置应该是CoreFoundation。

If you add two breakpoints, you should be able to debug these exceptions. To do this, go to Run | Show | Breakpoints and create two global breakpoints (I do them globally because they are so useful in all my applications). The first should be named "objc_exception_throw" and its location should be "libobjc.A.dylib". The second should be "-[NSException raise]" and its location should be "CoreFoundation".

现在,如果你开始调试你的应用程序并启用断点,它应该会破坏抛出这些例外。然后,您应该能够在调试器中看到导致异常的事件链。

Now, if you start debugging your application with breakpoints enabled, it should break on the throw of these exceptions. You should then be able to see the chain of events that led to the exception within the debugger.

这篇关于在Xcode / iPhone中堆栈跟踪或更多关于未处理异常的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆