• 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
Getting folder icon image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting folder icon image


  • Subject: Getting folder icon image
  • From: fritx <email@hidden>
  • Date: Tue, 2 Jul 2002 17:53:11 +0100

Hello, everyone

Sorry if this has been covered before, I am new to Cocoa. Can't find anything in the doc.s and even google has failed me.

I'm writing a little 'file browser' app that uses an NSOutlineView to show the file heirarchy to the user. I wanted to add an appropriate icon for the files in each cell as well and found that NSWorkspace seemed to have exactly what I wanted:

NSImage *fileImage = [[NSWorkspace sharedWorkspace] iconForFileType:[myFile extension]];

(Where [myFile extension] returns, for example @"tiff").
This works well but my problem is I can't find a way to get the image for file elements that have no extension (such as folders). Any ideas?

Cheers

Richard
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Getting folder icon image
      • From: Ondra Cada <email@hidden>
  • Prev by Date: (no subject)
  • Next by Date: [newbie] Hot Key
  • Previous by thread: Re: (no subject)
  • Next by thread: Re: Getting folder icon image
  • Index(es):
    • Date
    • Thread