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 (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to