• 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
Re: NSTextView replaceCharactersInRange performance and thread safety
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView replaceCharactersInRange performance and thread safety


  • Subject: Re: NSTextView replaceCharactersInRange performance and thread safety
  • From: Douglas Davidson <email@hidden>
  • Date: Tue, 4 Jan 2005 12:39:01 -0800


On Jan 4, 2005, at 12:31 PM, David Kocher wrote:


Thanks for the response! Indeed this seems to improve the performance; I was calling setFont: as the NSTextView reverts back the default Helvetica font if inserting a non-attributed string; I suppose this to be a bug.

A missing value for NSFontAttributeName gives you the default font. There are similar defaults for other attributes; see <AppKit/NSAttributedString.h> for details.



Frequent call to scrollRangeToVisible: still freezes/blocks the main thread (getting the spinning ball). I am however not sure if scrollRangeToVisible: can be called from another thread (I assume the appkit is not thread safe in general) - there doesn't seem to be much documentation on this topic.

Many portions of the AppKit are threadsafe, but layout in a particular text view/layout manager/text storage combo is not. You can scroll quickly to a particular point in the text view, but the problem is that until layout is finished you do not know how large the text view is so as to scroll to the end. One possibility would be to to install a delegate on the layout manager to be notified when layout is complete, and scroll then.


Douglas Davidson

_______________________________________________
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


  • Follow-Ups:
    • Re: NSTextView replaceCharactersInRange performance and thread safety
      • From: David Kocher <email@hidden>
References: 
 >NSTextView replaceCharactersInRange performance and thread safety (From: David Kocher <email@hidden>)
 >Re: NSTextView replaceCharactersInRange performance and thread safety (From: Douglas Davidson <email@hidden>)
 >Re: NSTextView replaceCharactersInRange performance and thread safety (From: David Kocher <email@hidden>)

  • Prev by Date: Re: NSTextView replaceCharactersInRange performance and thread safety
  • Next by Date: Tabbing thru tables
  • Previous by thread: Re: NSTextView replaceCharactersInRange performance and thread safety
  • Next by thread: Re: NSTextView replaceCharactersInRange performance and thread safety
  • Index(es):
    • Date
    • Thread