2012-01-19 6 views
3

Google Earthからkmlファイルとkmzファイルを開くことができるiOSアプリケーションを作成しようとしています。kmlとkmzのGoogle Earthファイルにiphoneアプリケーションを関連付けます。

<key>CFBundleDocumentTypes</key> 
    <array> 
    <dict> 
     <key>CFBundleTypeMIMETypes</key> 
     <array> 
      <string>application/vnd.google-earth.kml+xml</string> 
     </array> 
     <key>CFBundleTypeExtensions</key> 
     <array> 
      <string>kml</string> 
     </array> 
     <key>CFBundleTypeName</key> 
     <string>Google Kml</string> 
     <key>CFBundleTypeRole</key> 
     <string>Viewer</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
    </dict> 
</array> 

助けてください:私は(私は別のアプリケーション、すなわちメールからKMLファイルを開こうとすると、私は自分のアプリケーションが一覧表示されません)cfgファイルに以下の行を追加したが、間違っている必要があります 私のエラーを見つけるために...

+0

あなたのコード – Harish

+1

重複を示してxmlファイルを読み取ろうとするか - http://stackoverflow.com/questions/ 2774343/how-do-i-associate-file-types-an-iphone-application – Fraser

答えて

0

は、Info.plistファイルに次の行を追加します

<key>CFBundleDocumentTypes</key> 
    <array> 
     <dict> 
      <key>CFBundleTypeIconFiles</key> 
      <array/> 
      <key>CFBundleTypeName</key> 
      <string>Google Earth KML Document</string> 
      <key>LSItemContentTypes</key> 
      <array> 
       <string>com.google.earth.kml</string> 
      </array> 
     </dict> 
    </array> 
    <key>UTExportedTypeDeclarations</key> 
    <array> 
     <dict> 
      <key>UTTypeConformsTo</key> 
      <array> 
       <string>public.xml</string> 
      </array> 
      <key>UTTypeDescription</key> 
      <string>Google Earth KML Document</string> 
      <key>UTTypeIdentifier</key> 
      <string>com.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> 
     </dict> 
    </array> 
関連する問題