Re: attributesAtIndex:effectiveRange: vs the insertion point at end of text
Re: attributesAtIndex:effectiveRange: vs the insertion point at end of text
- Subject: Re: attributesAtIndex:effectiveRange: vs the insertion point at end of text
- From: Jérôme Laurens <email@hidden>
- Date: Wed, 18 Sep 2002 13:45:38 +0200
Le mercredi, 18 sep 2002, ` 10:20 Europe/Zurich, Dave Fayram a icrit :
I ran into the same problem, several methods in NSTextView seem to
break in this case.
What I did was detect if my selection began at the end of the text,
and if so decremented the insertion
point by 1. Usually this gets the behavior I'd more-or-less expect
from it.
I dunno why it breaks on that perfectly reasonable case, either. It's
really quite strange.
all these methods are documented to raise an exception if some part of
the range is outside the string.
methods for asking attributes are saying "what are the attributes of
the character at index: location", so it is natural to expect a
character at that location.
_______________________________________________
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.