• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Interruption of NSTreeController's selectionIndexPaths updating after mouseDown (From: Kirill K <email@hidden>)

  • Prev by Date: Re: Vertical alignment in NSTextView
  • Next by Date: Re: onSocketDidDisconnect in CocoaAsyncSocket
  • Previous by thread: Interruption of NSTreeController's selectionIndexPaths updating after mouseDown
  • Next by thread: Issues regarding NSTextStorage
  • Index(es):
    • Date
    • Thread