• 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
Re: NSHFSTypeCodeFromFileType troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSHFSTypeCodeFromFileType troubles


  • Subject: Re: NSHFSTypeCodeFromFileType troubles
  • From: Chris Gervais <email@hidden>
  • Date: Thu, 07 Mar 2002 15:13:27 -0500

Ah...I didn't even think to include the single quote as I thought that
NSHFSTypeCodeFromFileType just took the string as it was...the doc needs to
be more clear on this!

> Well OSTypes are just a 4 characters string const, like 'JPEG'.
>
> An file type right now for an HFSfile type(OSType) is encode like
> @"'JPEG'",
> note the single quotes this is important.
>
> Thanks,
> Andrew Pinski
>
>
> On Thursday, March 7, 2002, at 01:54 , Chris Gervais wrote:
>
>> So I'm trying to use the nifty Foundation function
>> NSHFSTypeCodeFromFileType() which doesn't appear to be a difficult
>> endeavor.
>>
>> NSHFSTypeCodeFromFileType is supposed to turn NSStrings into OSTypes.
>> Cool.
>>
>> However, I've tried passing several NSStrings into it, yet it always
>> returns
>> zero. The length of the strings are four characters and I've even
>> tried a
>> gimme like NSHFSTypeCodeFromFileType(@"JPEG") but I'm always getting
>> zero
>> back.
>>
>> Is there any hidden trick here or am I just missing something
>> super-obvious?
>> I was hoping that this function would be a quick way to create some
>> OSTypes
>> for me to pass along to various Carbon functions rather than having to
>> write
>> an NSString->OSType function, which, granted, isn't hard, but is just
>> one
>> more thing I didn't want to write. Of course, I probably could have in
>> the
>> time it took to write this message. Hmmm...is it too early for a
>> cocktail?
>>
>> Thanks,
>>
>> Chris
>> _______________________________________________
>> 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.
_______________________________________________
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: NSHFSTypeCodeFromFileType troubles
      • From: Ali Ozer <email@hidden>
    • Re: NSHFSTypeCodeFromFileType troubles
      • From: "David W. Halliday" <email@hidden>
References: 
 >Re: NSHFSTypeCodeFromFileType troubles (From: Andrew Pinski <email@hidden>)

  • Prev by Date: Re: Newbie (to Cocoa) questions
  • Next by Date: Re: Newbie (to Cocoa) questions
  • Previous by thread: Re: NSHFSTypeCodeFromFileType troubles
  • Next by thread: Re: NSHFSTypeCodeFromFileType troubles
  • Index(es):
    • Date
    • Thread