【问题标题】:UIKit -[UIApplication sendAction:to:from:forEvent:] crashUIKit -[UIApplication sendAction:to:from:forEvent:] 崩溃
【发布时间】:2014-04-10 02:12:56
【问题描述】:

我遇到了一个非常不寻常的问题..我在 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)

【问题讨论】:

  • 您是如何收到此错误的?请包括步骤,否则您在启动应用程序时收到此错误。
  • 这出乎意料..不知道我是怎么得到的...
  • 尝试使用异常断点stackoverflow.com/a/17802942/397915
  • 我从在我的客户设备上运行的应用程序中获得了这份报告。我无法在我自己的设备上复制它,所以使用异常断点没有好处。

标签: ios objective-c crash-reports


【解决方案1】:

你在objc_msgSend 中崩溃了。这意味着(如famous article 中所述)接收器丢失了。在这种情况下,用户似乎点击了一个向目标发送操作消息的按钮,但目标对象已不存在。

【讨论】:

  • 相同的解决方案是什么?
  • 即使您知道触发此崩溃的原因,也很难在特定行中定位。它让我疯狂。就我而言,它只发生在 iOS8 上,我们无法重现它。
【解决方案2】:

确保接收者或​​接收事件的对象被声明为强的。 您甚至可能无法通过崩溃日志找出问题所在:)

如果你得到类似上面的东西,检查对象是否被声明为强。这应该可以解决问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多