I'm using an NSCollectionView (with a custom NSCollectionViewLayout as its layout) to browse potentially thousands of local (on disk) images. What is the best way of ensuring scrolling stays smooth and memory usage (from loading the images to view) doesn't go through the roof?
Currently, each NSCollectionViewItem's representedObject is a class with an NSImage property. I tried making this property optional and loading the image file on viewDidAppear
(and setting it as nil
on viewWillDisappear
) but this stops the images loading at all (viewDidAppear
doesn't get called before the parent view is shown?).
All help much appreciated.