• 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
[NSWorkspace iconForFileType:someEncodedHFSFileType] - does this method actually work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[NSWorkspace iconForFileType:someEncodedHFSFileType] - does this method actually work?


  • Subject: [NSWorkspace iconForFileType:someEncodedHFSFileType] - does this method actually work?
  • From: Diggory Laycock <email@hidden>
  • Date: Wed, 2 Jan 2002 14:43:57 +0000

Happy New Year!

I've recently been trying to use the following method with no success at all:

[NSWorkspace iconForFileType:someEncodedHFSFileType]




I have written a tiny app to show my working:

http://www.monkeyfood.com/software/iconForFileType.sit (92k)

the main method of the controller class is reporoduced here:

-(void)awakeFromNib
{
NSString *theFileTypeString;
NSImage *theNSImage;
OSType theHFSFileType='HTML'; // We get the blank file icon, whatever
this value is.

[theImageView setImageScaling:NSScaleToFit];
theFileTypeString =NSFileTypeForHFSTypeCode(theHFSFileType);
theNSImage=[[NSWorkspace sharedWorkspace] iconForFileType: theFileTypeString
];
[theImageView setImage:theNSImage];
}


Does this method work at all with HFSFileTypes? I have used it successfully
with extensions, but when using HFSFileTypes it doesn't seem to return anything
but the blank-file icon.

Or have I made a glaring newbie error?

this message (http://cocoa.mamasam.com/COCOADEV/2001/05/1/6217.php) implies
that it should work with some types at least.

Thanks,

Diggory Laycock - MonkeyFood.com

Tel: +44 7050 124080
(07050 124080 from UK)


  • Follow-Ups:
    • Re: [NSWorkspace iconForFileType:someEncodedHFSFileType] - does this method actually work?
      • From: Andrew Platzer <email@hidden>
  • Prev by Date: Re: Translating filenames for command line?
  • Next by Date: Re: Translating filenames for command line?
  • Previous by thread: Re: NSTask, NSPipe's and interactive UNIX command
  • Next by thread: Re: [NSWorkspace iconForFileType:someEncodedHFSFileType] - does this method actually work?
  • Index(es):
    • Date
    • Thread