Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash at updateAttributeText #4

Open
NirajCapermint opened this issue May 24, 2019 · 4 comments
Open

Crash at updateAttributeText #4

NirajCapermint opened this issue May 24, 2019 · 4 comments

Comments

@NirajCapermint
Copy link

NirajCapermint commented May 24, 2019

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

@4taras4
Copy link

4taras4 commented Jul 26, 2019

how to fix it?

@k-lpmg
Copy link
Owner

k-lpmg commented Jul 26, 2019

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

@maulik6994
Copy link

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.

@AnswerX
Copy link

AnswerX commented Jul 14, 2021

 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants