Re: NSHFSTypeCodeFromFileType troubles
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.