Mel
Mel

Reputation: 969

How to programatically tell the Mac Finder to redraw a folder or file icon?

I have a process that modifies icons on files with an overlay. The Finder, though, seems to be caching the images it generates, which sometimes happens after I generate the overlay (in the case of the icon being a preview of the file instead of a plain icon).

Is there a programatic way I can tell the Finder to dump its cache for an icon image, and recreate it, without changing the file information, specifically the modification date?

Upvotes: 3

Views: 1180

Answers (1)

Anne
Anne

Reputation: 27073

Check: NSWorkspace Class Reference

Refresh the Finder like this:

[[NSWorkspace sharedWorkspace] noteFileSystemChanged:path];

Upvotes: 3

Related Questions