Sometimes the solution to a problem is so easy you feel like an utter and complete moron not for thinking of it before. See, for quite a while I've been tracking down standard system icons on my hard disk and adding them to my apps that needed to use them. Then, one day, Shawn Erickson (who is much smarter than me but not as grumpy on mailing lists, which is probably why his name might not ring a bell immediately, even though it should) comes along and not only points our collective noses at NSWorkspace's iconForFileType: method, but also shows us that the NSFileTypeForHFSTypeCode() function that's used to specify HFS type codes to NSOpenPanel and family will also work with that.

So, with a smattering of Carbon knowledge, you immediately realise that the entirety of Carbon's Icons.h header (part of HIServices.framework and thus available in every Cocoa app) has been available to you for ages but you didn't write cunning lines of code like:

NSImage* folderIcon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode(kGenericFolderIcon)];


NSImage* macIcon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode(kComputerIcon)];

I've known for a while that being stupid really does hurt, but I didn't expect to be able to measure it in bytes one day...