NSAttributed String Error in iOS 16.3.1 or above the error: Assertion failed: (forceBreakIndex > NSMaxRange(lastResortNode->lineBreak.range)), function -[_NSOptimalLineBreaker _calculateOptimalWrapping], file NSOptimalLineBreaker.m, line 1706.

So i found a bug which is to parse a html string with NSAttributedString and use it in textview using AttributedText. The error is this Assertion failed: (forceBreakIndex > NSMaxRange(lastResortNode->lineBreak.range)), function -[_NSOptimalLineBreaker _calculateOptimalWrapping], file NSOptimalLineBreaker.m, line 1706. The parsing seems to be working fine on iOS 15 or below, but in iOS 16 or above, it's crashed like the error previously mentioned.

I encountered the same error. After testing, it was possible that the crash was caused by too many rich text tags. However, on systems above iOS17, this issue does not occur. It seems that the crash only occurs on iOS16 systems. I wonder if you have resolved this issue on your end?

I encountered the same error. After testing, it was possible that the crash was caused by too many rich text tags. However, on systems above iOS17, this issue does not occur. It seems that the crash only occurs on iOS16 systems. I wonder if you have resolved this issue on your end?

NSAttributed String Error in iOS 16.3.1 or above the error: Assertion failed: (forceBreakIndex > NSMaxRange(lastResortNode->lineBreak.range)), function -[_NSOptimalLineBreaker _calculateOptimalWrapping], file NSOptimalLineBreaker.m, line 1706.
 
 
Q