scrollRangeToVisible
scrollRangeToVisible
- Subject: scrollRangeToVisible
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 10 May 2007 19:24:09 +0700
I have a method:
- (void)appendLogText: (NSString *)oneLine ;
{
NSTextStorage *textStorage = [ textView textStorage ];
NSAttributedString *att = [ [ NSAttributedString alloc ]
initWithString: oneLine attributes: logAttributes ];
[ textStorage appendAttributedString: att ];
[ att release ];
[ textView scrollRangeToVisible: NSMakeRange( [ textStorage length],
0 ) ];
}
If this method is called a few hundred of times, it becomes
incredibly slow.
The reason seems to be that scrollRangeToVisible: does a layout each
time it is called.
This is quite unneccessary, as the text view will be displayed only
at the end of the current event.
So what I need is obviously something like: (void)
justBeforeTheNextDisplayScrollRangeToVisible:(NSRange)aRange
Is there something like this? Or what can be used instead?
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden