1

我已经设置了其他二进制文档类型(例如 zip 档案),它们可以从 Safari 和 Mail 加载。但基于 XML 的格式仅运行“快速查看”并显示原始 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>
4

0 回答 0