很少,我们的应用程序崩溃,因为它收到SIGKILL。情况不同,但回溯总是一样的:
#0 0x94a00afa in mach_msg_trap ()
#1 0x94a01267 in mach_msg ()
#2 0x00fa9d5c in _UIPasteboardServerContainsTypesAtIndex ()
#3 0x00faa9ae in UIPasteboardServerContainsTypesAtIndex ()
#4 0x00fa5417 in -[UIPasteboard containsPasteboardTypes:] ()
#5 0x00de4054 in -[UITextField canPerformAction:withSender:] ()
#6 0x087038a8 in -[UIResponder(UITextAccessibilityUtilities) _accessibilityHasTextOperations] ()
#7 0x08704df5 in -[UIAccessibilityTextFieldElement _accessibilityHasTextOperations] ()
#8 0x08791dcf in -[NSObject(AXPrivCategory) accessibilityAttributeValue:] ()
#9 0x0878a3b4 in _copyMultipleAttributeValuesCallback ()
#10 0x087c5c95 in _AXXMIGCopyMultipleAttributeValues ()
#11 0x087c0a6c in _XCopyMultipleAttributeValues ()
#12 0x087c8e66 in mshMIGPerform ()
#13 0x020cf1c5 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#14 0x02034022 in __CFRunLoopDoSource1 ()
#15 0x0203290a in __CFRunLoopRun ()
#16 0x02031db4 in CFRunLoopRunSpecific ()
#17 0x02031ccb in CFRunLoopRunInMode ()
#18 0x02a43879 in GSEventRunModal ()
#19 0x02a4393e in GSEventRun ()
#20 0x00d2ba9b in UIApplicationMain ()
#21 0x0000284d in main (argc=1, argv=0xbfffed44) at [myapp]/main.m:14
#22 0x000027c5 in start ()
我如何找出导致此次崩溃的原因?
答案 0 :(得分:1)
SIGKILL被发送到应用程序以用于任何类型的例外。我们必须做出有根据的猜测,在这种情况下,异常原因是什么。在上面的例子中,看起来可访问性是检查某种类型的粘贴板类型是否存在。
由于这在Apple代码中发生,因此很可能这是iOS中的错误,因为containsPasteboardTypes:方法永远不会抛出异常。只有当传递的参数为nil时才有可能,但是那个bug将存在于UIAccessibilityTextFieldElement中,这也是Apple的责任。
长话短说:你需要提交雷达。作为一种解决方法,您可以在违规操作周围添加@try块。这会捕获并忽略异常。