NSLayoutManager's replaceTextStorage - slows down the text view?
NSLayoutManager's replaceTextStorage - slows down the text view?
- Subject: NSLayoutManager's replaceTextStorage - slows down the text view?
- From: Keith Blount <email@hidden>
- Date: Fri, 10 Dec 2004 07:21:44 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
Hello,
I have an app with a text view for which I would like
to provide a split view - ie. the user can drag up a
split pane so that he or she can edit one part of the
document whilst looking at another. In other words, I
need two text views with the same text storage. I had
thought that I had achieved this nicely, in the
recommended way, as follows:
- (void)awakeFromNib
{
[[mirrorView layoutManager]
replaceTextStorage:[textView textStorage]];
}
(where mirrorView and textView are both NSTextViews)
However, I have just realised that this is causing a
significant slowdown to my main text view (textView) -
whenever the user hits Return above a block of code,
it takes over a second for all the lines to be moved
down properly. If I take away the above code, the
slowdown goes away. I have checked a couple of other
apps - like Ulysses, for instance - and have noticed
that whilst their slowdown isn't anywhere near as bad
as in my own app (I still have to track down why that
is), it is still there.
Does anyone know why this causes such a lag, and does
anyone know how I can solve this?
Many thanks for any help,
Keith
__________________________________
Do you Yahoo!?
Send a seasonal email greeting and help others. Do good.
http://celebrity.mail.yahoo.com
_______________________________________________
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