Re: NSOutlineView threading problem
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