Error entering text in text field: _NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index 7

The application crashes when entering text in the uitextfiled file and receiving errors, for example: _NSLayoutTreeLineFragmentRectForGlyphAtIndex is an invalid glyph index 7. Any help would be greatly appreciated.

+4
source share
1 answer

The material __NSLayoutTreeLineFragmentRectForGlyphAtIndex invalid glyph index(as far as I know) does not cause a malfunction.

But, apparently, the main reason for both the failure and the incorrect glyph. Such errors appear in places like custom subclasses NSTextStorage -processEditingwhen you make changes to text storage, when the layout is executed, and / or vice versa.

TextKit

, . :

  • TextKit (!) , UITextField, . .
  • , . NSTextStorageDelegate .
  • , . ( , , :))

; , , :

  • NSGlyphGenerator, . . , .
  • NSTypesetter, , .
  • NSLayoutManager, . - .
  • NSTextStorage . , .

, , , , .

, , :)

0

Source: https://habr.com/ru/post/1532964/


All Articles