How do I create icon for my documents in OS X

2019-06-22 05:32发布

问题:

I have a document-based application. So I need an icon for my app as well as an icon for my documents.

In Xcode/Images.xcassets there is an item called AppIcon which I can use for setting the icon of the app.

But how do I make an icon for my documents?

Here is what I have tried under TARGETS/Document Types and TARGETS/Exported UTIs

I have tried different methods suggested on Internet but nothing works. The doc icon is always blank and empty as you can see below:

回答1:

It turns out that if you change your icon you have to change the extension as well in order for the icon to show up.

So what I did was to first test without any icon getting an empty icon, and then tried to add the real icon. That did not work. Instead as soon as you add a new icon, also make sure to change the extension.

It is funny how such a little thing can make you lose a whole day, and also that I didn't find even a hint on this on the net.