Actually, it seems that the NSWorkspace method behaves differently, (assuming 
I'm using it correctly):

[[NSWorkspace sharedWorkspace] filenameExtension:@"pdf" 
isValidForType:(NSString *)kUTTypeText]

returns YES

whereas the UTTypeConformsTo() solution returns NO.

So am I passing the wrong value for Type?

Cheers,

Martin




On 3, Jan, 2012, at 11:04 AM, Martin Hewitson wrote:

> 
> On 3, Jan, 2012, at 09:42 AM, Quincey Morris wrote:
> 
>> On Jan 2, 2012, at 23:57 , Martin Hewitson wrote:
>> 
>> 
>> Well, you don't need to ask *us* when the answer in the the documentation 
>> for the 'UTTypeCreatePreferredIdentifierForTag' function:
>> 
>>> "If no result is found, this function creates a dynamic type beginning with 
>>> the dyn prefix. This allows you to pass the UTI around and convert it back 
>>> to the original tag."
> 
> Oops. Completely missed that. Even after reading your post it took me a while 
> to see it. Probably time for another coffee.
> 
>> 
>> OTOH, I doubt that you really want to *create* a UTI just to test 
>> conformance, especially since you immediately discard the created UTI. 
>> What's wrong with using one of the NSWorkspace methods, such as 
>> 'filenameExtension:isValidForType:'?
> 
> Thanks! I didn't know about this NSWorkspace method. I think a google search 
> got me to the solution I was using. 
> 
> Anyway, thanks, I'll try the NSWorkspace method.
> 
> Cheers,
> 
> Martin
> 
> 
>> 
>> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Martin Hewitson
> Albert-Einstein-Institut
> Max-Planck-Institut fuer 
>     Gravitationsphysik und Universitaet Hannover
> Callinstr. 38, 30167 Hannover, Germany
> Tel: +49-511-762-17121, Fax: +49-511-762-5861
> E-Mail: [email protected]
> WWW: http://www.aei.mpg.de/~hewitson
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
    Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: [email protected]
WWW: http://www.aei.mpg.de/~hewitson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to