Hi!
I hope someone can help me.
A user told me that my app crashes when scrolling a tableView on iOS 13.1.2.
I received the crash log and the error it’s just crazy.
The crash log indicate that the error is at the first line inside the trailingSwipeActionsConfigurationForRowAt method.
override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
guard items.count > indexPath.row else {return nil} //This line crash.
…
}
The items property is defined as:
private var items = [AnyObject]()
The error is EXC_BREAKPOINT (SIGTRAP).
How can this line of code crash? items is a non optional variable and indexPath is also a non optional struct.
It's as if indexPath.row was deliberately creating an EXC_BREAKPOINT exception. It is possible?
Another strange thing is that the user say that the app crash during scrolling. It seems that the method trailingSwipeActionsConfigurationForRowAt is called during scroll. That's also strange, it should not be called only when the user does a left swipe? Maybe it has something to do with some accessibility feature because in the call stack of crash report I see some system accessibility methods calls (see crash report below).
Has anyone any ideas that can help me or has encountered a similar problem?
Thank you
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001de522a94
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [1431]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libswiftUIKit.dylib 0x00000001de522a94 $s10Foundation9IndexPathV5UIKitE7sectionSivgTm + 52
1 libswiftUIKit.dylib 0x00000001de522a78 $s10Foundation9IndexPathV5UIKitE7sectionSivgTm + 24
2 MYAPP 0x000000010219ca4c specialized GroupTableViewController.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 272 (GroupTableViewController.swift:714)
3 MYAPP 0x0000000102194544 @objc GroupTableViewController.tableView(_:trailingSwipeActionsConfigurationForRowAt:) + 136 (:0)
4 UIKitCore 0x00000001ad6ae200 -[UITableView _trailingSwipeConfigurationAtIndexPath:fromRemoveButton:] + 2140 (UITableView.m:16580)
5 UIKit 0x00000001de7889f0 -[UITableViewCellAccessibility _privateAccessibilityCustomActions] + 544 (UITableViewCellAccessibility.m:3153)
6 UIAccessibility 0x00000001b49e6228 -[NSObject(AXPrivCategory) _retrieveCustomActionsForElement:] + 72 (NSObjectAccessibility.m:2973)
7 UIAccessibility 0x00000001b49e650c -[NSObject(AXPrivCategory) _accessibilityCustomActions] + 260 (NSObjectAccessibility.m:3021)
8 UIAccessibility 0x00000001b49e9978 -[NSObject(AXPrivCategory) _accessibilityCustomActionNamesAndIdentifiers] + 68 (NSObjectAccessibility.m:3683)
9 UIAccessibility 0x00000001b49f07bc -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:] + 6580 (NSObjectAccessibility.m:6542)
10 UIAccessibility 0x00000001b49d1d9c _copyMultipleAttributeValuesCallback + 544 (UIAccessibilityRuntime.m:344)
11 AXRuntime 0x00000001b39fc834 ___AXXMIGCopyMultipleAttributeValues_block_invoke + 64 (AccessibilityPriv.m:1192)
12 AXRuntime 0x00000001b39fc3a8 _handleNonMainThreadCallback + 68 (AccessibilityPriv.m:467)
13 AXRuntime 0x00000001b39fc6b8 _AXXMIGCopyMultipleAttributeValues + 304 (AccessibilityPriv.m:1191)
14 AXRuntime 0x00000001b39f658c _XCopyMultipleAttributeValues + 396 (AccessibilityClientDefsServer.c:1354)
15 AXRuntime 0x00000001b3a0bd28 mshMIGPerform + 272 (MachServerHelper.c:447)
16 CoreFoundation 0x00000001a939d91c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 (CFRunLoop.c:1937)
17 CoreFoundation 0x00000001a939cfe8 __CFRunLoopDoSource1 + 448 (CFRunLoop.c:2075)
18 CoreFoundation 0x00000001a9397c20 __CFRunLoopRun + 2144 (CFRunLoop.c:3098)
19 CoreFoundation 0x00000001a9397098 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
20 GraphicsServices 0x00000001b3501534 GSEventRunModal + 108 (GSEvent.c:2246)
21 UIKitCore 0x00000001ad4b77ac UIApplicationMain + 1940 (UIApplication.m:4753)
22 MYAPP 0x000000010209cae8 main + 68 (PlaceViewController.swift:25)
23 libdyld.dylib 0x00000001a9216f30 start + 4