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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to