• 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: David Kocher <email@hidden>
  • Date: Tue, 4 Jan 2005 22:21:08 +0100

Douglas,
Wow (!); I have registered a delegate to the layout manager and do the scrolling when layoutManagerDidCompleteLayoutForTextContainer: is called; now it works like a charm. One thing I noticed is that the layout manager seems to change over time; I have to register using setDelegate: before every change to the text view otherwise the delegate method's aren't called - is this expected?


Thank you very much for your help; you would get a license key if it was payware ;)
-dk


On 4. Jan 2005, at 21:39, Douglas Davidson wrote:


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.

_______________________________________________ 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: Douglas Davidson <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>)
 >Re: NSTextView replaceCharactersInRange performance and thread safety (From: Douglas Davidson <email@hidden>)

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