EXC_BAD_ACCESS,但使用断点时不 [英] EXC_BAD_ACCESS, but not when using breakpoints

查看:76
本文介绍了EXC_BAD_ACCESS,但使用断点时不的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用崩溃了.它发生在dismissModalViewControllerAnimated:消息上,但是...如果我在NSLog上设置一个断点,然后跨步,就会遇到问题,EXC_BAD_ACCESS代码为2,地址为0x4:

I am getting a crash on my app. It's occurring on dismissModalViewControllerAnimated: message, but... if I set a breakpoint on the NSLog, and step over, it goes through with problem, the EXC_BAD_ACCESS code is 2 and address 0x4:

Thread 1: EXC_BAD_ACCESS(code=2, address=0x4)

如果没有断点和EXC_BAD_ACCESS,我从未有过任何帮助,有什么主意吗?

I've never had something work with breakpoints and EXC_BAD_ACCESS without them, any ideas?

请注意,我的appController很好. (不在任何地方发布).

Please note that my appController is fine. (not released anywhere).

if (appController.modalViewController) {
    NSLog(@"==== RETAIN COUNT ====> %d", appController.modalViewController.retainCount);

    [appController.modalViewController dismissModalViewControllerAnimated:NO];
}

将计数日志保留到 1

这也仅适用于iOS 4.2,并且我的应用仅在iPad上运行

This also ONLY happens for iOS 4.2 and my app is running on iPad only

推荐答案

retainCount是没有用的.不要叫它.

retainCount is useless. Don't call it.

如果发生崩溃,您将回溯.请张贴.

If you have a crash, you have a backtrace. Please post it.

我从来没有处理过断点和EXC_BAD_ACCESS 没有他们,有什么主意吗?

I've never had something work with breakpoints and EXC_BAD_ACCESS without them, any ideas?

通常表示比赛条件;您的代码取决于线程A在线程B达到某些特定状态之前是否完成某些工作.需要回溯.

Generally indicates a race condition; your code is dependent on thread A finishing or not finishing something before thread B hits some particular state. Need the backtrace.

这篇关于EXC_BAD_ACCESS,但使用断点时不的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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