Is there a way to define a UTI file (uniform type identifier) even if there is no file extension?
Now I get it like this when the file has the extension:
CFStringRef fileUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)[file pathExtension], NULL);
I found this snippet on the net whose goal is to do it on a Mac. But I'm on iOS:
CFStringRef typeString = UTCreateStringForOSType(outInfo.filetype);
itemUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, typeString, NULL);
CFRelease( typeString );
Note: outInfo is of type LSItemInfoRecord, which does not exist on iOS.
source
share