Given a file type (eg, DOC or PDF), how does one get a description similar to Finder's 'Kind'? For example, under Finder, DOC Kind is 'Word 97 Format (.doc)', and PDF Kind is 'Portable Document Format (PDF).
According to About Document Interaction, " iOS provides a systemwide registry of file type associations". But I don't believe I am pulling out the correct information (I'm not even really sure I'm using the aforementioned registry).
I'm using the code below, and it is returning 'com.microsoft.word.doc' for a DOC's kind. RTF is 'public.rtf', and PDF is 'com.adobe.pdf'. More bizarre is a link (webloc): 'dyn.age81s3pcrv10g'. None of the descriptions are user friendly.
NSURL* url = [NSURL fileURLWithPath:fullPathName];
if(url == nil)
return [extension uppercaseString]; // i.e., PDF
UIDocumentInteractionController* doc = [UIDocumentInteractionController interactionControllerWithURL: url];
if(doc == nil)
return [extension uppercaseString]; // i.e., PDF
return doc.UTI;