• 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: Doc kind from extension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doc kind from extension


  • Subject: Re: Doc kind from extension
  • From: Sidney San Martín <email@hidden>
  • Date: Fri, 12 Jun 2009 11:42:48 -0400

I would hope so! Neither of those functions are marked as deprecated
in the docs, so they're not going anywhere soon.
-Sidney

On Fri, Jun 12, 2009 at 6:21 AM, Micha Fuhrmann<email@hidden> wrote:
> Sidney thanks,
>
> Will this still be available in Snow Leopard?
>
> Michael
> On 11 juin 09, at 18:17, Sidney San Martín wrote:
>
>> How about this?
>>
>> CFStringRef UTI =
>> UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension,
>> CFSTR("pdf"), NULL);
>> NSString *name = [(NSString*)UTTypeCopyDescription(UTI) autorelease];
>> CFRelease(UTI);
>> // name is now "Portable Document Format (PDF)"
>>
>> -Sidney
>>
>> On Thu, Jun 11, 2009 at 11:47 AM, Micha Fuhrmann<email@hidden> wrote:
>>>
>>> Unfortunately all I can feed it with is the file extension....
>>>
>>> Any other idea? Isn't there a mapping plist between extension and Kind
>>> that
>>> exists somewhere?
>>>
>>> Michael
>>>
>>>
>>> On 11 juin 09, at 16:09, Graham Cox wrote:
>>>
>>>>
>>>> On 11/06/2009, at 11:50 PM, Micha Fuhrmann wrote:
>>>>
>>>>> Anyone knows how to get the system doc kind from a given extension. Not
>>>>> from a file, or a file path for that matter, but just from an
>>>>> extension.
>>>>> Like giving "pdf" and receiving "Portable Document Format (PDF). I've
>>>>> tried
>>>>>
>>>>> NSString * theTest = [[NSDocumentController sharedDocumentController]
>>>>> typeFromFileExtension:@"pdf"];
>>>>>
>>>>> But I get nil.
>>>>>
>>>>> Any idea?
>>>>
>>>>
>>>> [NSDocumentController displayNameForType:] ?
>>>>
>>>> --Graham
>>>
>>> _______________________________________________
>>>
>>> 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
>>>
>
>
_______________________________________________

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

References: 
 >Doc kind from extension (From: Micha Fuhrmann <email@hidden>)
 >Re: Doc kind from extension (From: Graham Cox <email@hidden>)
 >Re: Doc kind from extension (From: Micha Fuhrmann <email@hidden>)
 >Re: Doc kind from extension (From: Sidney San Martín <email@hidden>)
 >Re: Doc kind from extension (From: Micha Fuhrmann <email@hidden>)

  • Prev by Date: Re: view drawing differences between Tiger and Leopard ?
  • Next by Date: Re: Doc kind from extension
  • Previous by thread: Re: Doc kind from extension
  • Next by thread: Re: Doc kind from extension
  • Index(es):
    • Date
    • Thread