NSOutlineView threading problem
NSOutlineView threading problem
- Subject: NSOutlineView threading problem
- From: David <email@hidden>
- Date: Sat, 14 Jun 2008 22:19:56 -0400
I'm having various intermittent problems with NSOutlineView which I can only
presume is somehow caused by my use of a secondary thread to augment the
node tree supplied via a data source.
My assumption has been that I'm not doing anything that should cause
NSOutlineView a problem. I am strictly adding additional nodes to the tree.
I am not removing nor modifying existing trees.
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 cannot figure out what type of scenario could or should cause
NSOutlineView a problem. Any suggestions appreciated. So far I've noticed
three types of errant behavior at random inconsistent times:
1) A crash occurs with a nil pointer deep in the bowels of NSOutlineView
processing. I don't have source, so the stack trace doesn't mean much to me.
I never have even an intermediate state where any property or pointer is
nil. I fully construct the node before adding it to the tree.
2) The view displays the tree. I have code to expand the tree down to a
level of nodes created in the main thread. Sometimes after the view displays
the tree, it suddenly disappears as if some other layer redrew over it. The
outline view itself is still visible where I have it configured to a banded
background.
3) In the main thread, I create a few nodes, then spawn a thread to populate
the deepest node with children. In the main thread I tell the NSOutlineView
to expand the nodes that were created by the main thread, one layer higher
than where the children are being added.
The expanded view sometimes gets messed up. Sometimes it does not display
the last node as expandable even though I have code asking to reload the
nodes added in the main thread, and display the view.
Thanks
_______________________________________________
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