0

Good morning hive mind!

Working on a project that saves documents with the file extension "cpx" and have the dreaded generic icon problem.

A while ago I had setup a temporary icon for my custom documents and they worked fine. Months later, I finally got around to redesigning all of my icons, and after switching out the icon graphics, my Documents are now showing the generic document icon in stead of my custom icon.

I placed my app on a USB Drive and tried it on a friends machine (the first time the app was on that machine) and received the same result so it has to be something in my coding rather than a problem with the caches on my machine...

I'm by no means an expert here, so please forgive me if I've made a total Noob mistake... :) By the way, my documents all work correctly (file type, name, etc.), it's only a problem with the icon. Here are screenshots which may reveal the problem to a more advanced eye:

enter image description here

And for good measure here is a shot of my info.plist file:

enter image description here

Any help would be greatly appreciated!

Greg

Greg Steiner
  • 647
  • 1
  • 9
  • 20

1 Answers1

0

So... it looks like I found the solution, and as seemingly stupid as it is on the surface, it works and there's probably a good reason for it.

It seems that once you associate an icon graphic with a given UTI and/or extension, if you attempt to change the icon it causes problems and you get the generic icon. Strangely, I've tried all of the normal suggestions, like relaunching launch services, deleting prefs, etc., but nothing worked.

The workaround seems to be to change the UTI and Extension at the same time you change the icon. In my case, I changed the following:

com.q-station.document.cpx -> com.q-station.document.cpxw .cpx -> .cpxw

Then I added the new icon graphic, recompiled and lo and behold, it works perfectly.

Credit, where credit is due, here's the thread to the solution that worked for me:

How do I create icon for my documents in osx

Greg Steiner
  • 647
  • 1
  • 9
  • 20