• 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: NSCollectionView isn't playing nicely with selection binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCollectionView isn't playing nicely with selection binding


  • Subject: Re: NSCollectionView isn't playing nicely with selection binding
  • From: Rob Petrovec <email@hidden>
  • Date: Sun, 06 Nov 2016 19:28:44 -0700

The NSIndexSet variants are (soft) deprecated.  They will likely be hard deprecated (e.g. produce compiler warnings/errors) in a future release.  You should only use the NSIndexPath versions going forward.  Using a mix of the two variants of API is not supported.  To bind NSCollectionView -selectionIndexPaths to NSArrayController’s -selectionIndexes you will have to set up the observing glue to translate NSArrayController -selectionIndexes changes into a set of NSIndexPaths and call NSCollectionView -selectionIndexPaths, and vise versa.  Hope that helps.  Good luck.

—Rob


> On Nov 2, 2016, at 7:31 AM, Steve Mills <email@hidden> wrote:
>
> So NSCollectionView can bind its selectionIndexes, so I've bound that to an array controller that's shared with an NSTableView. Only one of the two are ever shown at the same time, but many things depend on the array controller's selectionIndexes. The trouble is, changes to the collection view's selection don't notify the selectionIndexes binding. I've subclasses the collection view just so I could override all the various selection methods to see what's going on. The methods that use a set of NSIndexPath are always called, but the NSIndexSet versions are not.
>
> On the other side of the mountain, selection cells in the table view always updates the bound property, so the collection view gets notified that the selectionIndexes have changed.
>
> How can I make NSCollectionView work better? I didn't have this problem when I was using IKImageBrowserView instead of NSCollectionView. Seems silly that Apple added all the stuff to support multiple sections, but didn't bother to keep things working with regard to the binding.
>
> --
> Steve Mills
> Drummer, Mac geek
>
>
> _______________________________________________
>
> 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


_______________________________________________

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: 
 >NSCollectionView isn't playing nicely with selection binding (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Fonts in TableView
  • Next by Date: Re: Is NSCollectionView size not controllable in 10.10?
  • Previous by thread: NSCollectionView isn't playing nicely with selection binding
  • Next by thread: Is NSCollectionView size not controllable in 10.10?
  • Index(es):
    • Date
    • Thread