Finish with an uncaught exception of type NSException when you touched the screen

advertisements

edit: I solved the problem by disabling Accessibility option from UITextField's identifier window. I really don't understand how this solved my problem.

I'm following Stanford University CS193p Swift course online and I tried to write the code that was written during lecture 9 and I've encountered an error. The project I'm trying to do is a simple Twitter client app. There is a UITableViewController and app runs without any problem. When I added a UITextField on top of UITableView, app launches fine but when I touch the screen I have this error message on console:

2017-01-31 22:02:48.152 Smashtag[39223:3430950] -[UIAccessibilityTextFieldElement convertPoint:fromView:]: unrecognized selector sent to instance 0x6180000519a0
2017-01-31 22:02:48.156 Smashtag[39223:3430950] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIAccessibilityTextFieldElement convertPoint:fromView:]: unrecognized selector sent to instance 0x6180000519a0'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010a605d4b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010a06721e objc_exception_throw + 48
    2   CoreFoundation                      0x000000010a675f04 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x000000010a58b005 ___forwarding___ + 1013
    4   CoreFoundation                      0x000000010a58ab88 _CF_forwarding_prep_0 + 120
    5   UIAccessibility                     0x000000011debdddb -[NSObject(AXPrivCategory) _accessibilityHitTestSupplementaryViews:point:withEvent:] + 477
    6   UIKit                               0x000000011dd3572a -[UITableViewAccessibility _accessibilityHitTest:withEvent:] + 173
    7   UIKit                               0x000000011dd4eb2b -[UIViewAccessibility __accessibilityHitTest:withEvent:] + 1859
    8   UIKit                               0x000000011dd4f979 -[UIViewAccessibility _accessibilityHitTest:withEvent:] + 101
    9   UIKit                               0x000000011dd4eb2b -[UIViewAccessibility __accessibilityHitTest:withEvent:] + 1859
    10  UIKit                               0x000000011dd4f979 -[UIViewAccessibility _accessibilityHitTest:withEvent:] + 101
    11  UIKit                               0x000000011dd4eb2b -[UIViewAccessibility __accessibilityHitTest:withEvent:] + 1859
    12  UIKit                               0x000000011dd4f979 -[UIViewAccessibility _accessibilityHitTest:withEvent:] + 101
    13  UIKit                               0x000000011dd4eb2b -[UIViewAccessibility __accessibilityHitTest:withEvent:] + 1859
    14  UIKit                               0x000000011dd4f979 -[UIViewAccessibility _accessibilityHitTest:withEvent:] + 101
    15  UIKit                               0x000000011dd67e34 -[UIWindowAccessibility _accessibilityHitTest:withEvent:] + 101
    16  UIAccessibility                     0x000000011deb137f _copyElementAtPositionCallback + 1722
    17  AXRuntime                           0x000000011cea7955 _AXXMIGCopyElementAtPosition + 169
    18  AXRuntime                           0x000000011cea1aab _XCopyElementAtPosition + 311
    19  AXRuntime                           0x000000011ceb0de5 mshMIGPerform + 266
    20  CoreFoundation                      0x000000010a5973d9 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    21  CoreFoundation                      0x000000010a597351 __CFRunLoopDoSource1 + 465
    22  CoreFoundation                      0x000000010a58f435 __CFRunLoopRun + 2389
    23  CoreFoundation                      0x000000010a58e884 CFRunLoopRunSpecific + 420
    24  GraphicsServices                    0x000000010f769a6f GSEventRunModal + 161
    25  UIKit                               0x000000010aa29c68 UIApplicationMain + 159
    26  Smashtag                            0x0000000109a3406f main + 111
    27  libdyld.dylib                       0x000000010dead68d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

I checked the outlet connections and I think there is no wrong connection or something similar. How can I solve this problem?


I encountered the exact same issue. I found that any time I had a UITextField in the header of a UITableView, trying to interact with my app on the simulator would crash with that same exception.

After much flailing around, I eventually thought to disable BetterTouchTool (version 2.071).

Without BetterTouchTool running, I no longer encounter that issue.

I haven't looked further into what functionality or settings in BetterTouchTool might be to blame