I have a rather large image, which I display inside NSImageView
. Once I do it the first time, every next usage of said image is very fast. Either when re-using the NSImageView
it was assigned to or assigning it to a new NSImageView
. This is apparently due to the fact that NSImage
keeps cache of the representation it used for displaying said image the first time. The problem is with displaying it the first time though. Even on a fast hardware there is an unacceptably long delay before the image eventually appears. What I am looking for is a way to pre-cache the image representation before I display it the first time. Any suggestions?
FWIW, I use Obj-C for OS X/macOS but I believe it shouldn't make any difference and Swift techniques should be applicable too.