You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

UTImportedTypeDeclarations异常及OPML导入导出功能问题求助

Hey there, let's break down and fix your OPML import/export issues step by step:

Issue 1: OPML files turn gray/unusable after installing other OPML-supporting apps

This is almost always a UTI (Uniform Type Identifier) conflict—when multiple apps claim ownership of the same file type, iOS might prioritize another app's declaration over yours. Here's how to resolve it:

  • First, make sure your UTExportedTypeDeclarations uses the standard OPML UTI: org.opml.opml. Avoid generic identifiers like public.opml since other apps might be using those too.
  • In your CFBundleDocumentTypes configuration, set the LSHandlerRank to Owner. This tells iOS your app is the primary handler for OPML files, reducing the chance of other apps overriding it.
  • Double-check your UTI declaration's conformance—OPML is an XML-based format, so your UTTypeConformsTo array should include public.xml and public.text to align with system categories.
  • Finally, uninstall and reinstall your app, then restart your device. iOS caches UTI associations, so a fresh install often clears conflicting entries.

Issue 2: OPML file icons not showing despite adding 22x29 and 44x58 resources

Icon display issues usually stem from missing configuration or cached assets. Try these fixes:

  • Add icon references to both UTI and document type declarations:
    In your UTExportedTypeDeclarations dictionary, add the UTTypeIconFiles key pointing to your icon files (omit the file extension, e.g., OPMLIcon22x29 instead of OPMLIcon22x29.png).
    Also, include the same icon filenames in the CFBundleTypeIconFiles array under CFBundleDocumentTypes—iOS sometimes pulls icons from this section instead of the UTI declaration.
  • Verify icon assets:
    Ensure your icons are added to your project's target (check Build Phases > Copy Bundle Resources to confirm they're included). For full compatibility, add a 3x version (66x87 pixels) alongside your 1x and 2x icons.
  • Clear icon cache:
    iOS caches file icons aggressively. Restart your device after updating icon assets or configuration—this is often the missing step to make new icons appear.

Example corrected Info.plist snippets

For your UTI declaration:

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.xml</string>
            <string>public.text</string>
        </array>
        <key>UTTypeIdentifier</key>
        <string>org.opml.opml</string>
        <key>UTTypeDescription</key>
        <string>OPML Outline File</string>
        <key>UTTypeIconFiles</key>
        <array>
            <string>OPMLIcon22x29</string>
            <string>OPMLIcon44x58</string>
            <string>OPMLIcon66x87</string> <!-- Optional but recommended -->
        </array>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>opml</string>
            </array>
            <key>public.mime-type</key>
            <string>text/x-opml</string>
        </dict>
    </dict>
</array>

For your document type association:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>OPML Outline File</string>
        <key>CFBundleTypeIconFiles</key>
        <array>
            <string>OPMLIcon22x29</string>
            <string>OPMLIcon44x58</string>
            <string>OPMLIcon66x87</string>
        </array>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>org.opml.opml</string>
        </array>
    </dict>
</array>

Give these steps a try—they should resolve both your grayed-out files and missing icon issues!

内容的提问来源于stack exchange,提问作者Anton Breza

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 10:41:06