2

My NSCollectionViewItem is in a separate xib file. It has an image view. Previously I was setting image directly on the NSImageView. The UI worked fine.

Now, I have added a CALayer to NSImageView. I use it to display images and transition from from one image to another.

Problem is: each time user adds a new NSCollectionViewItem. CALayers of NSCollectionViewItem blinks/flashes and sometimes disappear altogether. This happens at random. Sometimes CALayer of every item disappears. Other times only few items' CALayer disappear.

Then if I add another item or resize the NSCollectionView by resizing the container Window, which makes NSCollectionView to reshuffle all the items. CALayer appear back, but not always. This also random. Some items remain CALayer-less.

My guess is that animation of NSCollectionView is messing up the NSCollectionViewItem's CALayer.

Any idea what is going on? Is there some sample code/open source project that uses CALayer in NSCollectionViewItem?

Any help, any tip, no matter how small, would be highly appreciated.

Andrew-Dufresne
  • 5,464
  • 7
  • 46
  • 68

0 Answers0