Re: Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode]
Re: Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode]
- Subject: Re: Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode]
- From: "Sean McBride" <email@hidden>
- Date: Mon, 26 May 2008 12:17:50 -0400
- Organization: Rogue Research
On 5/24/08 8:10 AM, Gerriet M. Denkmann said:
>>> From what I have read quickly since Sean McBride sent his comment,
>>> UTIs are
>>> not yet implemented to the point where I could get the UTI of
>>> every file on
>>> my computer.
>>
>> Sure you can. Use LSCopyItemAttributes() with kLSItemContentType.
>
>How do you know this?
>
>I just read "An Overview of UTI Functions" in the "Uniform Type
>Identifiers Overview" and did find no mention at all of this.
>(Actually I had been looking for something like LSCopyItemAttribute
>(), concluded that this did not exist, further concluded that this
>nice technology obviously was only half implemented by Apple and that
>I had to wait another year or two before it was usable).
Gerriet,
I forget how I learned this originally. In fact, it took me several
minutes to find the answer for you in the docs. I guess this is an
example of how the docs could be improved. And yes, UTI support has
been slow in coming. It was only in 10.5 that NSOpenPanel got support
for them, for example. However, UTI support is now pretty good as of
10.5. Beware though that the UTI mechanism has no way to deal with
conflicting file extensions. So if two different application declare
different UTIs for the same extension, you don't know which UTI you'll get!
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden