Reputation: 1645
Is there a way, in OSX SDK, to represent a file in UI, by presenting its icon ? In other words, is it possible to access the icon for a specific file, to show it in a NSImageView for example ?
PS: I'm using MonoMac, but Objective-C code will certainly help me too :)
Thanks in advance
Upvotes: 2
Views: 2646
Reputation: 3558
I used this category https://github.com/incbee/NSImage-QuickLook very helpful.
Upvotes: 0
Reputation: 34263
You can use NSWorkspace's iconForFile:
e.g.:
[[NSWorkspace sharedWorkspace] iconForFile:@"/Applications/Launchpad.app"];
If you need icons for a certain file type, you can use iconForFileType:
Upvotes: 9