Search code examples
macoscocoauti

Overlapping UTI declarations for same file extension


Users of my application keep running into issues related to other applications declaring a different UTI for the same file extension as my application. I think I can best describe this with an example:

My application supports importing and exporting OPML files. For this to work I import the org.opm.opml UTI in my info.plist. This mostly works fine, but fails if an other application declares a different UTI for the opml file extension. For example com.redlex.opml or com.xwavesoft.cloudoutliner.opml.

Is there something I can do to work around this problem? Can I somehow tell launch services that my application accepts all files with an .opml extension?


Solution

  • I solved this issue with the following work around:

    1. I removed the entire LSItemContentTypes entry from the list of CFBundleDocumentTypes
    2. In my NSDocument subclass I use NSString's rangeOfString:: method to look for the @"opml" keyword in the typeName parameter.

    This work around was confirmed by a user.