Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSDocument custom icon not displaying in Finder but displaying in Quick Look

I'm designing a custom application and I've set a custom icon for my file type.

I've put the icon on both Document Types and Exported UTIs section (filling in other values too, obviously).

Here is what I get when I run:

enter image description here

No icon is defined in Finder

enter image description here

But in Quick Look, it displays correctly.

I've seen CFBundleTypeIconFile Icon not showing for given file extension and tried rebuilding the launch services database. I've restarted Finder, cleaned Xcode project/derived data etc. and re-run, but nothing changed. Finder still doesn't display my icon. My ICNS file has all the required sizes contained. Everything works fine otherwise (when I double click it opens correctly with my app etc). By the way, my file DOES have the extension, it just doesn't display in Finder. I can verify that it has the correct extension by lsing in terminal.

How can I make Finder show my icon?

like image 376
Can Poyrazoğlu Avatar asked Jul 04 '15 13:07

Can Poyrazoğlu


1 Answers

I found this solution, which worked for me. I did not have to restart my Mac, just the Finder (I have a little AppleScriptlet to tell it to quit).

Execute the following commands:

sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {} \;
sudo rm -rf /Library/Caches/com.apple.iconservices.store
killall Finder

Then relaunch the Finder or log out and back in, or restart your Mac.

like image 71
Rick Avatar answered Nov 03 '22 01:11

Rick