I'm trying to add this feature to my app: when pushing a certain button, open a quick look view of a certain file.
I saw this: Use Quick Look inside a Swift cocoa application to preview audio files, but the error written in the comments shows up and the app crashes after trying to go back and forth between files.
Apple's class reference of QLPreviewPanel is quite empty.
Which is a correct implementation? What is wrong in the answer in the question I linked?