A handy UTI tip

I found this by accident, when I wrote this code while tired:

UTTypeConformsTo(type, CFSTR("kUTTypeText"))

That's wrong. It should be either kUTTypeText or CFSTR("public.text"). But it works anyway.

The real question is whether CFSTR("kUTTypeText") works in Panther (the global constant kUTTypeText was introduced in Tiger). In any case, I'll just use CFSTR("public.text") and keep Panther compatibility.

Technorati tags: Uniform type identifiers, Launch Services.


Post a Comment

links to this post:

Create a Link

<< Home