EXC_BAD_ACCESS错误,没有信息

时间:2014-11-12 14:01:14

标签: swift exc-bad-access

我得到了臭名昭着的EXC_BAD_ACCESS错误 在Xcode 6.1项目中进行im编译是用Swift编写的。

我在理解崩溃时遇到问题,我能得到的唯一信息是:

(lldb) bt
* thread #1: tid = 0xef65e, 0x0000000192ba3bd0 libobjc.A.dylib`objc_msgSend + 16, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1399ebeb8)
frame #0: 0x0000000192ba3bd0 libobjc.A.dylib`objc_msgSend + 16
frame #1: 0x0000000186c78d70 UIKit`_UIConvertDisplayPointToWindow + 404
frame #2: 0x0000000186f08114 UIKit`__70+[UIWindow _hitTestToPoint:forEvent:windowServerHitTestWindow:screen:]_block_invoke + 136
frame #3: 0x0000000186c51580 UIKit`+[UIWindow _topVisibleWindowPassingTest:] + 176
frame #4: 0x0000000186f08074 UIKit`+[UIWindow _hitTestToPoint:forEvent:windowServerHitTestWindow:screen:] + 148
frame #5: 0x0000000186eea990 UIKit`_UIApplicationHandleEventFromQueueEvent + 8812
frame #6: 0x0000000186c4b8f4 UIKit`_UIApplicationHandleEventQueue + 1616
frame #7: 0x00000001824560e8 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #8: 0x000000018245538c CoreFoundation`__CFRunLoopDoSources0 + 264
frame #9: 0x000000018245343c CoreFoundation`__CFRunLoopRun + 712
frame #10: 0x00000001823811f4 CoreFoundation`CFRunLoopRunSpecific + 396
frame #11: 0x000000018b5175a4 GraphicsServices`GSEventRunModal + 168
frame #12: 0x0000000186cb2784 UIKit`UIApplicationMain + 1488
* frame #13: 0x00000001001b2700 #APPNAME#`top_level_code + 76 at AppDelegate.swift:18
frame #14: 0x00000001001b280c #APPNAME#`main + 48 at AppDelegate.swift:0
frame #15: 0x00000001931fea08 libdyld.dylib`start + 4

如何开始调试?

1 个答案:

答案 0 :(得分:2)

我很高兴清理代码有帮助......这种类型的事情发生的情况非常罕见,但经常发生,你会记得偶尔清理一下代码。


我原来的评论。 尝试清理您的项目,有时可以帮助修复任何可能给出编译器错误的缓存链接库,如果是编译器错误,那么什么时候会出现此错误?

并且可能希望为将来出现的任何问题添加此项,当发生Exec Bad访问错误时,通常是您正在访问一个nil或在某个时间点变为nil的对象并尝试使用它,因此请继续检查那些强弱的参考文献。