iOS EXC

编程入门 行业动态 更新时间:2024-10-26 11:12:46
本文介绍了iOS EXC_BAD_ACCESS:如何调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在获得一个EXC_BAD_ACCESS。我知道这通常是什么意思:尝试访问不存在的对象(不再)是最有可能的原因。

那么,我在哪里可以找到? / p>

我已经看过互联网上的大量帖子,他们都说:

启用NSZombie 。

现在,当我运行调试器,我该怎么看?我看不到任何差异...

注意:这不是关于我的代码中的perticular错误,而是通常如何使用启用NSZombie的调试器

解决方案

我会做的是在绿色箭头上方找到一个断点,显示EXC_BAD_ACCESS错误。然后再次运行您的代码并重现步骤来生成崩溃。

当您进入断点时,您可以使用右键单击和打印描述来检查对象是否为有效对象在Xcode的控制台左侧,或在XCode的控制台部分输入命令'po'。这就是我通常检测错误的方式。

有用的是在调试器停止后跟踪堆栈。它在左侧面板中显示了断点之前的方法的线索和链接。

希望这有助于我,并希望我对如何跟踪的方法的描述错误有帮助。

I am getting an EXC_BAD_ACCESS. I know what this usually means: Trying to access an object that doesn't exist (anymore) is the most likely cause.

So, where do I find that?

I have read numerous posts on the internet, and they all say:

"Enable NSZombie" in the scheme.

Now when I run the debugger, for what should I look? I can not see any difference...

Note: This is not about a perticular error in my code, but generally how to use the debugger with NSZombie enabled

解决方案

What I would do it will be to locate a breakpoint just one line above the green arrow showing the EXC_BAD_ACCESS error. Then run again your code and reproduce the steps to generate the crash.

When you get to your breakpoint you can check that your objects are valid objects using right click and print description in the left side of your console within Xcode or typing the command 'po' within the console section in XCode. That's how I usually detect the errors.

Something useful is to trace the stack once the debugger stopped. It show in the left panel the threads and chain of invocations of the methods before the break point.

Hope this helps and hope my description of the alternative in how to track the error helps.

更多推荐

iOS EXC

本文发布于:2023-11-26 12:33:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633938.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:iOS   EXC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!