Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > add custom icon for file type

add custom icon for file type
Thread Tools
Fresh-Faced Recruit
Join Date: Aug 2006
Status: Offline
Reply With Quote
Aug 12, 2006, 11:10 AM
 
I recently started to use the D programming language and I download a d.pblangspec and d.pbfilespec to give me syntax highlighting and stuff, but the icon for .d files is the plain white document icon. I have an icon named dfile.icns that I want to use and I put it in the Xcode.app/Contents/Resources/ and then I edited the Info.plist in Xcode by adding a dictionary under the CFBundleDocumentTypes array and put the following to the dictionary I created:

An array called CFBundleTypeExtensions with a string with the value "d".
A string called CFBundleTypeIconFile, with the value "dfile.icns"
An array called CFBundleTypeMIMETypes with a string with the value "text/plain"
A string called CFBundleTypeName with the value "D Source File"
An array CFBundleTypeOSTypes with a string with the value "TEXT"
A string CFBundleTypeRole with the value "Editor"
A boolean LSIsAppleDefaultForType with the value Yes
A boolean LSTypeisPackage with the value No
A string NSDocumentClass with the value "PBXSourceFileDocument"

When I create a .d file the icon is still the the plain default document icon, but if I go to Get Info->Open With->Other and choose Xcode (even though it already is on Xcode) the icon changes to the one I want, but if I choose Change All it goes back to the normal default white document icon.

Does anyone know how to get this to work?
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Aug 12, 2006, 12:25 PM
 
This sounds like a LaunchServices bug. Try deleting your LaunchServices cache and rebooting. That might do it.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Fresh-Faced Recruit
Join Date: Aug 2006
Status: Offline
Reply With Quote
Aug 19, 2006, 10:06 PM
 
Thanks (sorry I didn't respond earlier, I kept forgetting to check the forum for an answer). It works now.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:56 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2