• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
scrollRangeToVisible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: scrollRangeToVisible
      • From: Jonathon Mah <email@hidden>
    • Re: scrollRangeToVisible
      • From: Douglas Davidson <email@hidden>
    • Re: scrollRangeToVisible
      • From: Jay Reynolds Freeman <email@hidden>
  • Prev by Date: Re: Get the Mac address programmatically
  • Next by Date: Using custom NSController subclasses in IB
  • Previous by thread: Re: Get the Mac address programmatically
  • Next by thread: Re: scrollRangeToVisible
  • Index(es):
    • Date
    • Thread