• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to obtain icon displayed by Finder for a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to obtain icon displayed by Finder for a file


  • Subject: Re: How to obtain icon displayed by Finder for a file
  • From: Peter Ammon <email@hidden>
  • Date: Wed, 7 Jan 2009 13:52:50 -0800


On Jan 7, 2009, at 1:42 PM, David wrote:

Hello,Is there a way to obtain the icon that finder uses to display for a
file system object? Such things as the folder icon for folders, PDF icon for
pdfs etc.


You can use -[NSWorkspace iconForFile:] if you want to get a specific file's icon, respecting any custom icons.

Use -[NSWorkspace iconForFileType:] if you want to get the icon for a type. The type can be a filename extension or an HFS type code encoded via NSFileTypeForHFSTypeCode(). On Leopard or later it can also be a UTI.

-Peter

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to obtain icon displayed by Finder for a file (From: David <email@hidden>)

  • Prev by Date: Re: How to obtain icon displayed by Finder for a file
  • Next by Date: Re: How to obtain icon displayed by Finder for a file
  • Previous by thread: Re: How to obtain icon displayed by Finder for a file
  • Next by thread: Re: How to obtain icon displayed by Finder for a file
  • Index(es):
    • Date
    • Thread