I am looking for a method exactly like -[NSWorkspace iconForFile:] but which returns the icon in a higher resolution if possible. In particular, I have an app which makes use of QuickLook to display previews of files, and I’d like it to fall back to the file icon if no quick look plugin is available. Using the iconForFile: method, however, yields a small 32×32 icon. Is there a better method around? One that returns an NSImage or CGImageRef is preferred, but less accessible methods might be fine too.
I am looking for a method exactly like -[NSWorkspace iconForFile:] but which returns the
Share
The returned image of
-[NSWorkspace iconForFile:]contains multiple representations, including higher resolution ones.If you try drawing it at 512×512 it will automatically pick the appropriate representation.