• 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: NSOutlineView threading problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView threading problem


  • Subject: Re: NSOutlineView threading problem
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 14 Jun 2008 21:03:32 -0700


On 14 Jun '08, at 7:19 PM, David wrote:

I am using NSMutableArrays to hold the nodes in the tree. One thread is
adding child nodes while the main thread maybe accessing the arrays through
the data source. I find it hard to imagine that NSMutableArray could be
causing the problem.

I don't think that's safe. I have seen no assurances that NSOutlineView is thread-safe, and in general most AppKit control classes should _not_ be accessed from background threads.


The best thing to do is have your background thread use - performSelectorOnMainThread:, calling a method on itself that will take the child nodes as a parameter and add them to the outline.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: NSOutlineView threading problem
      • From: David <email@hidden>
References: 
 >NSOutlineView threading problem (From: David <email@hidden>)

  • Prev by Date: Re: using NSFileManager to read data
  • Next by Date: Re: NSOutlineView threading problem
  • Previous by thread: NSOutlineView threading problem
  • Next by thread: Re: NSOutlineView threading problem
  • Index(es):
    • Date
    • Thread