Tagging icon indicating copy to clipboard operation
Tagging copied to clipboard

Crash at updateAttributeText

Open NirajCapermint opened this issue 5 years ago • 4 comments

It works well for the first time tag user using @ mentions. When I try same for the second time it crashes on the function:

private func updateAttributeText(selectedLocation: Int) {

Could not get the cause of this crash but it is important to me if it resolve asap. Thanks!

Following is the crash log I'm getting:

Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds' *** First throw call stack: (0x1831b3164 0x1823fc528 0x1831b30ac 0x183aaf594 0x183aaf9f0 0x10339e880 0x10339e9ac 0x1033a255c 0x103453c14 0x10339be4c 0x10339cc94 0x10339d484 0x18c9149ec 0x18c7ac294 0x18c9144d8 0x18c9136d0 0x18c913528 0x18c91345c 0x18cbd735c 0x18cbd665c 0x18d431fac 0x18c7975f0 0x183baf2e4 0x18315b77c 0x18315b6fc 0x18315af84 0x183158b5c 0x183078c58 0x184f24f84 0x18c7d15c4 0x1008a0da0 0x182b9856c) libc++abi.dylib: terminating with uncaught exception of type NSException

NirajCapermint avatar May 24 '19 05:05 NirajCapermint

how to fix it?

4taras4 avatar Jul 26 '19 15:07 4taras4

Hi, @NirajCapermint @4taras4 Could you please give me a specific example of how the crash appears?

k-lpmg avatar Jul 26 '19 18:07 k-lpmg

Yes @k-lpmg , I am also getting same crash don't sure when?

Please provide us the solution. Because I have many users for my current Application. PLEASE.

maulik6994 avatar Dec 13 '19 10:12 maulik6994

 public func textViewDidChangeSelection(_ textView: UITextView) {
        tagging(textView: textView)
        updateAttributeText(selectedLocation: textView.selectedRange.location)
    }

Add some spaces before the tag and paste a word like "the" which is more than one character and it crashes. The range is out of bounds @maulik6994

AnswerX avatar Jul 14 '21 05:07 AnswerX