crash when subclassing NSTextStorage
crash when subclassing NSTextStorage
- Subject: crash when subclassing NSTextStorage
- From: jerome LAURENS <email@hidden>
- Date: Mon, 27 May 2002 10:03:09 +0200
Hi,
I subclassed NSTextStorage the way the doc explains it.
My underlying model object is just a NSMutableString, not an
NSMutableAttributedString.
Everything works well except when the text uses soft wrapping: my app
crashes.
So i override the "lineBreakBeforeIndex:..." to see what happens and I
see that the return value is sometimes very big (unsigned) -1 : the
index is out of the string range. I just decided to force the return of
a value within the good range
if super returns a value in the range, keep this value
else return the min or max of the range (the closest)
and everything is working well now.
I am afraid this strange behaviour is hiding a bug in my concrete
NSTextStorage subclass implementation... Any hint?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.