XCode 4不在EXC_BAD_ACCESS的正确行上中断 [英] XCode 4 Not Breaking On Correct Line on EXC_BAD_ACCESS

查看:74
本文介绍了XCode 4不在EXC_BAD_ACCESS的正确行上中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的xcode升级到了版本4,并且我的代码中有一个EXC_BAD_ACCESS exception,但是尽管在环境中设置了NSZombieEnabled,它仍然在线程1 int retVal = UIApplicationMain(argc, argv, nil, nil);行上显示了断点.

我确定我已经在XCode 3中对此进行了配置,以使其停止在导致异常的代码行中.现在,它不执行此操作,也不会在GDB窗口中显示任何错误消息.

有人知道我可能会想念什么吗?

谢谢 雷

解决方案

EXC_BAD_ACCESS也不例外,至少就断点而言-这意味着代码正在尝试在不存在的对象上调用方法不再是因为您发布了它.

在XCode4中找到此最简单的方法是运行乐器(Cmd-I),然后在弹出的对话框中询问您使用哪种乐器,选择僵尸".然后执行任何导致崩溃的操作,您将看到一个弹出对话框,显示僵尸消息".单击小箭头,您将获得创建,保留或释放对象的历史记录.然后,您可以找出谁提前释放了该对象.

I recently had my xcode upgraded to version 4, and I have an EXC_BAD_ACCESS exception in my code, but despite setting NSZombieEnabled in the environment it's still showing the break point on the thread1, int retVal = UIApplicationMain(argc, argv, nil, nil); line.

I'm sure I had this configured in XCode 3 to stop on the line of my code that was causing the exception. Now it doesn't do that and displays no error messages in the GDB window either.

Does anyone know what I might be missing?

Thanks Ray

解决方案

EXC_BAD_ACCESS is not an exception, at least not as far as breakpoints are concerned - it means the code is trying to call a method on an object that does not exist anymore, because you released it.

The easiest way to find this in XCode4 is to run Instruments (Cmd-I), and in the dialog that pops up asking you which instrument to use, choose "Zombies". Then do whatever to cause the crash, and you will see a dialog pop up with "Zombie Messaged". Click on the little arrow and you will get a history of what created, retained, or released the object. Then you can figure out who released the object early.

这篇关于XCode 4不在EXC_BAD_ACCESS的正确行上中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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