QuickLook preview never displays NSImageView

I have an NSImageView-based preview appex plugin for macOS in Objective-C. It's based off the sample template that you can add to an app.

It completely makes it through preparePreviewOfFileAtURL, and I stuff pixel data into a CGImage, then that into an NSImage and that onto an NSImageView that is self.view from the storyboard. I can see all data via qlManager -p, since it will print error messages for caveman debugging. I have no idea and there are no docs on using the "Quick Look Simulator" which appears to do nothing.

I set background color of the NSImageView.layer to red, and it shows up red. So I know the NSImageView is visible, just not the image that it also points to.

About 30% of the time, only the red shows up, and the other 70% of the time nothing shows up in preview just smokey blurred version of the icons underneath in Finder.

My only recourse, is to disable the extension list for the preview appex, and let the thumbnailer appex provide the preview. There are no samples of this for macOS, and the default templates aren't a working version of this either.

I finally got this to work by designating the Storyboard as a NSView (Instead of NSImageView), and then adding the NSImageView with addSubview of that. But now I need the subview to auto-layout to the parent's bounds. That's at least a fixable problem.

QuickLook preview never displays NSImageView
 
 
Q