Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
- Subject: Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
- From: Kirill K <email@hidden>
- Date: Thu, 28 Apr 2011 17:46:42 +0300
Hello,
Problem Background:
I have a NSOutlineView with every tableColumn binded programmatically
to the NSTreeController's arrangedObjects so there is no need to bind
selectionIndexPaths. The source of NSTreeController's arrangedObjects
is a mutableArray. I'm adding all nodes to the NSTreeController
dynamically by performing - (void)insertObject:(id)object
atArrangedObjectIndexPath:(NSIndexPath *)indexPath; on main thread. I
have overridden NSOutlineView's mouseDown event in the way like:
- (void)mouseDown:(NSEvent *)event
{ /*...myMethods...*/
[super mouseDown:event];}
The Problem:
When the nodes are being added very fast and I perform the mouseDown
event on the outlineView, then very often the next situation takes
place:
the thread that adds nodes to TreeController interrupts the sequence
(I guess) called by mouseDown event so insertObject:
atArrangedObjectIndexPath: is called before
thensetSelectionIndexPaths:. That's why the new selection in
outlineView disappears and treeController still has the old version of
selectedIndexPaths.
I've tried one partial solution: blocked my insertObject: method
(with@synthesized(outlineView)) so that it couldn't change the entire
of outlineView, but it often rises in thread conflict and app freezes.
Are there any ideas how to solve the problem with disappearing selections?
Regards,
Kirill
_______________________________________________
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