• 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
Another Icon Question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another Icon Question.


  • Subject: Another Icon Question.
  • From: Diggory Laycock <email@hidden>
  • Date: Sun, 30 Dec 2001 16:46:15 +0000

Apologies in advance if this Q is too simple to clog-up the list.

I am looking for a way to get an Icon given a creator and filetype.
I have sucessfully used:

[[NSWorkspace sharedWorkspace] iconForFileType:theExtension]

to get an icon given an extension, and have tried:

theFileTypeString =NSFileTypeForHFSTypeCode(theFileType);
theNSImage=[[NSWorkspace sharedWorkspace] iconForFileType: theFileTypeString ];

but always get the "white/blank document" icon. Which actually makes sense,
since an icon for filetype doesn't make much sense without a creator code.


is this a carbon thing? I can't find anything better than NSWorkspace in Cocoa, and it doesn't seem to quite do the job.

Thanks.

Diggory Laycock - MonkeyFood.com


  • Prev by Date: Re: NSAlias and RecentItems
  • Next by Date: Re: Unexpected behavior of NSNumberFormatter
  • Previous by thread: Re: Setting a file's icon
  • Next by thread: Coding Protocol?
  • Index(es):
    • Date
    • Thread