iOS17.2 UITextView click rich text( link ) crash

enter image description here

crash info

*** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[_UITextInteractableLinkItem attachment]: unrecognized selector sent to instance 0x600003e9fb80’
*** First throw call stack:
(
0 CoreFoundation 0x000000011a519761 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x000000011edab904 objc_exception_throw + 48
2 CoreFoundation 0x000000011a52e873 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x000000011a51def4 forwarding + 1459
4 CoreFoundation 0x000000011a5200f8 _CF_forwarding_prep_0 + 120
5 UIKitCore 0x000000015bea3005 __56-[_UITextInteractableItemCache itemForAttachment:range:]_block_invoke + 53
6 UIKitCore 0x000000015bea39f3 __59-[_UITextInteractableItemCache _cachedItemInSet:predicate:]_block_invoke + 16
7 CoreFoundation 0x000000011a532658 __40-[NSSet objectsWithOptions:passingTest:]_block_invoke + 20
8 CoreFoundation 0x000000011a431524 NSSET_IS_CALLING_OUT_TO_A_BLOCK + 7
9 CoreFoundation 0x000000011a431800 __NSSetEnumerate + 730
10 CoreFoundation 0x000000011a532544 -[NSSet objectsWithOptions:passingTest:] + 207
11 UIKitCore 0x000000015bea3990 -[_UITextInteractableItemCache _cachedItemInSet:predicate:] + 117
12 UIKitCore 0x000000015bea2f87 -[_UITextInteractableItemCache itemForAttachment:range:] + 182
13 UIKitCore 0x000000015b0531b5 +[_UITextInteractableItem itemForAttachment:range:textItemInteractingView:location:] + 117
14 UIKitCore 0x000000015c342f62 -[UITextView _textInteractableItemAtPoint:precision:] + 1184
15 UIKitCore 0x000000015c25982b -[_UITextSimpleLinkInteraction _canBeginInteractionSessionForLinkAtPoint:asTap:precision:] + 94
16 UIKitCore 0x000000015c2595f9 -[_UITextSimpleLinkInteraction interaction_gestureRecognizer:shouldReceiveTouch:] + 232
17 UIKitCore 0x000000015c257bd0 -[UITextInteraction gestureRecognizer:shouldReceiveTouch:] + 289
18 UIKitCore 0x000000015b83567b -[UIGestureRecognizer _delegateShouldReceiveTouch:forEvent:] + 477
19 UIKitCore 0x000000015b83501a -[UIGestureRecognizer

how to fix it? I need help

  • Well we’d need to see your code to help you. Also, when posting code, please don’t just copy paste from your project, but submit a minimal, reproducible example.

    – 

Leave a Comment