Re: Trouble with text system (NSTextStorage)
Re: Trouble with text system (NSTextStorage)
- Subject: Re: Trouble with text system (NSTextStorage)
- From: email@hidden
- Date: Mon, 14 Nov 2005 14:59:26 -0800
It depends on how its configured, but I'm guessing when you type the
text, your using replaceCharactersAtIndex: ?
I bet somewhere in the editing its not being calculated right and the
index is somehow accumulating.. possibly including the newly typed
text length and the length of the old string.
Just a guess!
Also this explains a lot: http://developer.apple.com/documentation/
Cocoa/TextFonts-date.html
On 平成 17/11/13, at 14:29, Michael Becker wrote:
Hi all,
I am really new to the whole text system, so my question will
probably sound unclear to those in the know. I am trying to
implement rectangular text-objects, similar to those that you see
in the Sketch example. Actually I took a lot of code from the
Sketch example. However, here's my problem: Say, I have 2 different
text rectangles on screen. Both are set with an initial string of
"Your Text Here".
Now I can happily edit each one as much as I want without a
problem, AS LONG AS I do not insert strings longer than "Your Text
Here". So if I change one's string to "Your Text Here Now", as soon
as I want to select the OTHER one, I get this error:
2005-11-13 23:23:36.149 SalesGenie[3979] -[NSTextStorage
attribute:atIndex:effectiveRange:] called with out-of-bounds index.
For apps linked on Tiger this will raise an exception. For earlier
apps it will produce this one-time warning and continue with
existing behavior (which is undefined).
2005-11-13 23:23:36.150 SalesGenie[3979] *** -
[NSConcreteTextStorage attribute:atIndex:effectiveRange:]: Range or
index out of bounds
2005-11-13 23:23:46.182 SalesGenie[3979] *** -
[NSConcreteTextStorage attribute:atIndex:effectiveRange:]: Range or
index out of bounds
2005-11-13 23:23:47.689 SalesGenie[3979] *** NSRunStorage
(387e330), _replaceElements(): replaced range {0, 73} extends
beyond current run storage size 17.
I really have no clear vision of all those TextStorages,
LayoutManagers, TextViews, etc.
I just wonder what is happening, as I think that I took all the
critical code directly from the Sketch-Example.
I am not actually expecting a solution to my problem, I guess I
could not provide enough information for that. But I would be happy
to maybe know where to start looking.
I am using a shared LayoutManager and a shared TextView just like
Sketch does....
Regards,
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden