Re: Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
Re: Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
- Subject: Re: Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
- From: Quincey Morris <email@hidden>
- Date: Wed, 04 May 2011 01:02:24 -0700
On Apr 28, 2011, at 07:46, Kirill K wrote:
> the thread that adds nodes to TreeController interrupts the sequence
> (I guess) called by mouseDown event so insertObject:
> atArrangedObjectIndexPath: is called before
> thensetSelectionIndexPaths:.
If you guess the sequence of events when it fails, you may end up chasing the wrong problem. :) Better to actually find out what's going wrong. However ...
I think you have two fundamental flaws in your approach:
-- How well it works is going to depend on whether the NSOutlineView uses an event tracking loop or not, in response to 'super mouseDown:event:'. Predicting its behavior seems very fragile, and you'll need a deeper understanding of run loop modes to analyze the behavior.
-- You *think* you've solved a thread synchronization problem by pushing the 'insertObject:...' calls into the main thread. You haven't. You've solved 2 sub-problems: (1) preventing KVO notifications leading to UI updates on a background thread, and (2) preventing data corruption resulting from using non-thread-safe methods in multiple threads simultaneously.
Those are the easy things. The hard thing is to *design* a thread synchronization strategy that actually works.
_______________________________________________
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