How do you programmatically put folder icons on the Finder sidebar, given that you have to use a custom icon for the folder?

后端 未结 3 752
醉酒成梦
醉酒成梦 2020-12-09 00:36

Am currently working on a project, and though I can add sidebar items by adding to the com.apple.sidebarlists.plist file then restarting Finder, I can\'t seem to know how to

3条回答
  •  醉梦人生
    2020-12-09 01:12

    There's no supported way to do this using pure Cocoa. Use the LSSharedFileList API, instead. It's the supported way to manage the sidebar lists, and you can provide a custom icon (as an IconRef from Icon Services) when you insert an item.

提交回复
热议问题