• 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
NSCollectionView.selectionIndexes goes wrong
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSCollectionView.selectionIndexes goes wrong


  • Subject: NSCollectionView.selectionIndexes goes wrong
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 06 Jan 2015 22:01:22 -0800

I've just noticed that after an NSCollectionView's content property changes, its selectionIndexes property doesn't change. So even though the change in content means the selected items may now have different indexes, or may no longer exist at all, the selectionIndexes still contains the old obsolete indexes. This can easily cause crashes in app code, and does in my app, when it uses the selectionIndexes to index into the content array and blows up with an index-out-of-range.

As far as I can tell, this is an NSCollectionView bug. I'm surprised I didn't notice it earlier; it may be a regression in Yosemite. Anyone else notice it? (Yeah, I'll file a Radar if it appears to be unknown.)

—Jens
_______________________________________________

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


  • Prev by Date: Re: URLByResolvingBookmarkData not case sensitive
  • Next by Date: NSOutlineView click and bug
  • Previous by thread: UIAutomation, cannot tap UIImagePickerController Choose button
  • Next by thread: NSOutlineView click and bug
  • Index(es):
    • Date
    • Thread