Trouble with text system (NSTextStorage)
Trouble with text system (NSTextStorage)
- Subject: Trouble with text system (NSTextStorage)
- From: Michael Becker <email@hidden>
- Date: Sun, 13 Nov 2005 23:29:41 +0100
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