NSCollectionView.selectionIndexes goes wrong
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