UIKit - [UIApplication sendAction:to:from:forEvent:]崩溃

Ahm*_* Z. 10 objective-c crash-reports ios

我遇到了一个非常不寻常的问题..我在UIKit上遇到了崩溃..我第一次面对这样的事情..请任何人指导我的...

这是我得到的崩溃日志.

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x1161a18c

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x386fcb66 objc_msgSend + 5
1  UIKit                          0x30b5dda3 -[UIApplication sendAction:to:from:forEvent:] + 90
2  UIKit                          0x30cc5615 -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 120
3  UIKit                          0x30b5dda3 -[UIApplication sendAction:to:from:forEvent:] + 90
4  UIKit                          0x30b5dd3f -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 38
5  UIKit                          0x30b5dd13 -[UIControl sendAction:to:forEvent:] + 46
6  UIKit                          0x30b49743 -[UIControl _sendActionsForEvents:withEvent:] + 374
7  UIKit                          0x30b5d75b -[UIControl touchesEnded:withEvent:] + 594
8  UIKit                          0x30b5d425 -[UIWindow _sendTouchesForEvent:] + 528
9  UIKit                          0x30b58451 -[UIWindow sendEvent:] + 832
10 UIKit                          0x30b2dd79 -[UIApplication sendEvent:] + 196
11 UIKit                          0x30b2c569 _UIApplicationHandleEventQueue + 7116
12 CoreFoundation                 0x2e36ff1f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
13 CoreFoundation                 0x2e36f3e7 __CFRunLoopDoSources0 + 206
14 CoreFoundation                 0x2e36dbd7 __CFRunLoopRun + 630
15 CoreFoundation                 0x2e2d8471 CFRunLoopRunSpecific + 524
16 CoreFoundation                 0x2e2d8253 CFRunLoopRunInMode + 106
17 GraphicsServices               0x330122eb GSEventRunModal + 138
18 UIKit                          0x30b8d845 UIApplicationMain + 1136
19 TradeMate                      0x0008f2bf main (main.m:16)
Run Code Online (Sandbox Code Playgroud)

mat*_*att 7

你正在崩溃objc_msgSend.这意味着(正如这篇着名的文章中所解释的那样)接收器已经丢失了.在这种情况下,似乎用户点击了一个向目标发送动作消息的按钮,但目标对象已经不存在.