• 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: NSTreeController selection and Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTreeController selection and Swift


  • Subject: Re: NSTreeController selection and Swift
  • From: Rick Mann <email@hidden>
  • Date: Tue, 24 May 2016 23:49:22 -0700

> On May 24, 2016, at 23:45 , Quincey Morris <email@hidden> wrote:
>
> On May 24, 2016, at 23:26 , Rick Mann <email@hidden> wrote:
>>
>> Eh, I think I'll just use my current workaround using NSOutlineView methods.
>
> Really? There’s nothing wrong with using ‘selectedObjects’. The only drawback is that it has to create an actual NSArray each time you ask for it, but that’s not a meaningful performance penalty in most situations.
>
> Another alternative is to bind the tree controller’s selectionIndexPaths binding to a property in your view/window controller. In effect, that binds the outline view’s selection *through* the tree controller to your property. Because it’s maintained by a binding, the property will be KVO compliant, or you can use the ‘outlineViewSelectionDidChange:’ delegate method. (The difference is that the delegate method is not invoked for *programmatic* changes of the selection.)

Oh, that sounds like the right solution. Thanks!


--
Rick Mann
email@hidden



_______________________________________________

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: 
 >NSTreeController selection and Swift (From: Rick Mann <email@hidden>)
 >Re: NSTreeController selection and Swift (From: Quincey Morris <email@hidden>)
 >Re: NSTreeController selection and Swift (From: Rick Mann <email@hidden>)
 >Re: NSTreeController selection and Swift (From: Quincey Morris <email@hidden>)
 >Re: NSTreeController selection and Swift (From: Rick Mann <email@hidden>)
 >Re: NSTreeController selection and Swift (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: NSTreeController selection and Swift
  • Next by Date: Getting the Version Number from an NSRunningApplication?
  • Previous by thread: Re: NSTreeController selection and Swift
  • Next by thread: Getting the Version Number from an NSRunningApplication?
  • Index(es):
    • Date
    • Thread