Get badges for special paths in cocoa

I am trying to get special paths (at home, desktop, applications, ...), the icons you see are the sidebar of the crawler. I tried the iconForFile method for NSWorkspace, but instead got the blue folder icons. Do you know how I can get other badges?

Thank you for your help,

+4
source share
1 answer
NSString *fileType = NSFileTypeForHFSTypeCode(kToolbarDesktopFolderIcon); NSImage *desktopToolbarImage = [[NSWorkspace sharedWorkspace] iconForFileType:fileType]; 

If you double-click on the command (Xcode 3) or click on the command (Xcode 4) in the constant kToolbarDesktopFolderIcon , you will get to the file (IconsCore.h), which contains a whole bunch of default constants of the system icons. The special icon icons in the toolbar you are looking for are in the same group. kToolbarDownloadsFolderIcon will get you a white down arrow in a green circle, kToolbarHomeIcon will give you a house icon, etc.

+5
source

Source: https://habr.com/ru/post/1346510/


All Articles