• 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: Threads & NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads & NSTextView


  • Subject: Re: Threads & NSTextView
  • From: Chris Hanson <email@hidden>
  • Date: Sun, 24 Jul 2005 14:21:55 -0700

On Jul 24, 2005, at 4:56 AM, Laurent Michel wrote:

Ok. performSelectorOnMainThread: did the trick. So, now, for educational purpose, what is the intended use of this pair of methods then ? (lockFocusIfCanDraw, and unlockFocus) ?

The intended use is just as described in "Cocoa Thread Safety" at <http://developer.apple.com/documentation/Cocoa/Conceptual/ Multithreading/articles/CocoaSafety.html>. You can use them to draw into a view from another thread.


However, you can only *draw* into the view. Manipulating the view's state -- or the state of objects the view depends on, for example an NSTextView's textStorage -- is not the same as drawing NSBezierPaths.

I would recommend that, in general, the only thing that should invoke any of the focus-locking methods on a view is the view itself. This is because a view should know how to render itself, and if it supports rendering outside the normal Cocoa update mechanism, it should provide methods to do so that wrap things like focus-locking and state synchronization.

  -- Chris

_______________________________________________
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


References: 
 >Threads & NSTextView (From: Laurent Michel <email@hidden>)
 >Re: Threads & NSTextView (From: Chris Hanson <email@hidden>)
 >Re: Threads & NSTextView (From: Laurent Michel <email@hidden>)

  • Prev by Date: Re: NSCreateCommand
  • Next by Date: Re: Problem with japanese systems
  • Previous by thread: Re: Threads & NSTextView
  • Next by thread: UnEditable OutlineView Cell and Right Click
  • Index(es):
    • Date
    • Thread