• 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 get icon of special folder (like /Applications or /Library)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get icon of special folder (like /Applications or /Library)?


  • Subject: Re: How to get icon of special folder (like /Applications or /Library)?
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 16 Oct 2008 15:02:02 -0500

On Oct 16, 2008, at 10:08 AM, Alexander Shmelev wrote:

On Mac OS X many special folders have their own personal icons. For example "/Applications" have capital letter "A" on generic folder icon.

I have some path which leads to some special folder. How can I determine what icon this folder have?
Path is stored in NSString.

In general, to get the icon for any item in the file system, you can use:


	[[NSWorkspace sharedWorkspace] iconForFile:pathToTheFile]

Also, just in case, you should not hard-code "/Applications" or any other path to a special folder in your code. You should use NSSearchPathForDirectoriesInDomains or FSFindFolder to determine the path to a special folders at run time.

Cheers,
Ken

_______________________________________________

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 get icon of special folder (like /Applications or /Library)? (From: Alexander Shmelev <email@hidden>)

  • Prev by Date: Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:
  • Next by Date: Calling UNIX command from Cocoa
  • Previous by thread: Re: How to get icon of special folder (like /Applications or /Library)?
  • Next by thread: iPhone Development Mailing List
  • Index(es):
    • Date
    • Thread