EXC_BAD_ACCESS错误

时间:2012-09-04 17:24:19

标签: iphone objective-c ios ios4 exc-bad-access

  

可能重复:
  How do I set up NSZombieEnabled in Xcode 4?

我正在调试一个应用程序,它在执行某个导航功能时会抛出exec-bad-access错误,但只有当我在设备上运行它时才会抛出。

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xf0000008
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x3421bf78 objc_msgSend + 16
1   UIKit                           0x31d9a28c -[UIWebView    webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 68
2   CoreFoundation                  0x321ce7dc __invoking___ + 60
3   CoreFoundation                  0x321297aa -[NSInvocation invoke] + 154
4   CoreFoundation                  0x321293c8 -[NSInvocation invokeWithTarget:] + 44
5   WebKit                          0x365f6e06 -[_WebSafeForwarder forwardInvocation:] + 246
6   CoreFoundation                  0x321cda7c ___forwarding___ + 660
7   CoreFoundation                  0x32128648 _CF_forwarding_prep_0 + 40
8   CoreFoundation                  0x321ce7dc __invoking___ + 60
9   CoreFoundation                  0x321297aa -[NSInvocation invoke] + 154
10  WebCore                         0x358fa1ee _ZL11SendMessageP12NSInvocation + 18
11  WebCore                         0x3590d6ea _ZL20HandleDelegateSourcePv + 74
12  CoreFoundation                  0x3219facc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 8
13  CoreFoundation                  0x3219f298 __CFRunLoopDoSources0 + 208
14  CoreFoundation                  0x3219e03e __CFRunLoopRun + 646
15  CoreFoundation                  0x3212149e CFRunLoopRunSpecific + 294
16  CoreFoundation                  0x32121366 CFRunLoopRunInMode + 98
17  GraphicsServices                0x31278432 GSEventRunModal + 130
18  UIKit                           0x31c20cce UIApplicationMain + 1074
19  Parliament                      0x0007396a main (main.m:14)
20  Parliament                      0x00073928 start + 32

这是错误日志。有谁知道为什么这是或如何我可以调试这样的错误,因为运行thruogh一个仪器没有肝脏

1 个答案:

答案 0 :(得分:1)

您可能已经发布了一个对象,然后尝试在webView中访问该对象:decisionPolicyForNavigationAction委托方法。

在调试版本设置中启用“Zombie”检测: How do I set up NSZombieEnabled in Xcode 4?

这将帮助您识别对象是否未被正确保留。