It turned out I was modifying the stringValue
of a NSTextView while it was calling textDidEndEditing:
, which resulted in a mismatched string count and a Range or index out of bounds
exception thrown when this wrong count was being used inside NSTextView
inner methods.
I just bypassed the problem by using an ivar @property BOOL canModifyTextViewString
which would be set accordingly inside methods where modifying the string is unsafe/not possible.