我已经设置了其他二进制文档类型(例如zip存档),它们从Safari和Mail加载就好了。但基于XML的格式只运行“Quick View”并显示原始XML代码。是否还需要做其他事情来支持基于XML的格式?这是我用于这些类型的info.plist:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Icon-72.png</string>
<string>Icon.png</string>
</array>
<key>CFBundleTypeName</key>
<string>GPS Exchange Format (GPX)</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.topografix.gpx</string>
</array>
</dict>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Icon-72.png</string>
<string>Icon.png</string>
</array>
<key>CFBundleTypeName</key>
<string>Google Earth KML</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.google.earth.kml</string>
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>com.google.earth.kml</string>
<key>UTTypeDescription</key>
<string>Google Earth KML</string>
<key>UTTypeReferenceURL</key>
<string>http://earth.google.com/kml/</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<string>GKml</string>
<key>public.filename-extension</key>
<array>
<string>kml</string>
</array>
<key>public.mime-type</key>
<string>application/vnd.google-earth.kml+xml</string>
</dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>com.topografix.gpx</string>
<key>UTTypeReferenceURL</key>
<string>http://www.topografix.com/GPX/1/1/</string>
<key>UTTypeDescription</key>
<string>GPS Exchange Format (GPX)</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>gpx</string>
</array>
<key>public.mime-type</key>
<string>application/gpx+xml</string>
</dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
</dict>
</array>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>com.google.earth.kml</string>
<key>UTTypeDescription</key>
<string>Google Earth KML</string>
<key>UTTypeReferenceURL</key>
<string>http://earth.google.com/kmz/</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>com.apple.ostype</key>
<string>GKml</string>
<key>public.filename-extension</key>
<array>
<string>kml</string>
</array>
<key>public.mime-type</key>
<string>application/vnd.google-earth.kml+xml</string>
</dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
</dict>
<dict>
<key>UTTypeIdentifier</key>
<string>com.topografix.gpx</string>
<key>UTTypeDescription</key>
<string>GPS Exchange Format (GPX)</string>
<key>UTTypeReferenceURL</key>
<string>http://www.topografix.com/GPX/1/1/</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>gpx</string>
</array>
<key>public.mime-type</key>
<string>application/gpx+xml</string>
</dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.xml</string>
</array>
</dict>
</array>
</dict>