Re: NSCollectionView, disappearing items on reloadData

2023-01-11 Thread Arved von Brasch via Cocoa-dev
Hi List, A follow up. I’m reasonably sure this was a binding issue. I had connected the ‘dataSource’ outlet and implemented the data source methods and also bound the NSCollectionView to the ‘arrangedObjects’ binding of the same NSArrayController. The binding always failed, but using the data s

Re: NSCollectionView, disappearing items on reloadData

2023-01-08 Thread Arved von Brasch via Cocoa-dev
Thanks Rob. I can confirm that ‘prepareForReuse()’ is *not* called after the ‘reloadData()’ call. I can also confirm the Data Source functions still contain the expected information. Again, this is an interesting case where the working Collection View behaves as expected (prepareForReuse() is ca

Re: NSCollectionView, disappearing items on reloadData

2023-01-08 Thread Rob Petrovec via Cocoa-dev
NSCollectionView, like NSTableView/NSOutlineView, will reuse existing views instead of recreating them when it can to speed up the UI. This is most commonly used during scrolling where views that scroll out of view will be reused with new data and scrolled into view. It will call -prepareForReus