Re: How to get icon of special folder (like /Applications or /Library)?
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