NSWorkSpace SetIcon is not refreshing

I am using NSWorkSpace SetIcon: forFile: options: in the folder. However, although the API returns success (true) every time the api is used, sometimes the icon does not update in the folder.

I noticed that creating a new file inside the folder would cause a new icon to appear, which makes me think the Finder should update the folder.

Is there a way to determine when the icon was actually installed and the folder needs updating? And is there a way to update the folder without creating and deleting the file quickly?

thank

+3


source to share


1 answer


It turns out there is a feature to help notify Finder when a file has changed. NSWorkSpace noteFileSystemChanged does this. However, it doesn't work for changing folder icons.



It looks like the only option is to create / delete the file.

+2


source







All Articles