Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >How to get icon of special folder (like /Applications or /Library)? (From: Alexander Shmelev <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.