2013-06-03 68 views
0

我想讓我的應用程序導入電子郵件sqlite文件,所以我創建了文檔類型和自定義UTI在我的info.plist。然而,當我收到一封電子郵件sqlite的文件在我的應用程序打開該選項不會出現:自定義sqlite UTI不工作

這裏的文檔類型定義:

DocType

和這裏的UTI

UTI

我現在已經修改了以下內容來創建一個名爲.icx的自定義文件擴展名。然而,當我試圖打開一個附件ICX,我給出的唯一選項的Dropbox,郵件和FileAppPro:

<key>CFBundleDocumentTypes</key> 
    <array> 
     <dict> 
      <key>CFBundleTypeIconFiles</key> 
      <array> 
       <string>inCommand icon114</string> 
      </array> 
      <key>CFBundleTypeName</key> 
      <string>icx Database</string> 
      <key>CFBundleTypeRole</key> 
      <string>Editor</string> 
      <key>LSHandlerRank</key> 
      <string>Owner</string> 
      <key>LSItemContentTypes</key> 
      <array> 
       <string>com.ncbath.inControl.icx</string> 
      </array> 
     </dict> 
    </array> 


<key>UTExportedTypeDeclarations</key> 
    <array> 
     <dict> 
      <key>UTTypeConformsTo</key> 
      <array> 
       <string>public.data</string> 
      </array> 
      <key>UTTypeDescription</key> 
      <string>icx Database</string> 
      <key>UTTypeIdentifier</key> 
      <string>com.ncbath.inControl.icx</string> 
      <key>UTTypeSize320IconFile</key> 
      <string>inCommand icon114</string> 
      <key>UTTypeSize64IconFile</key> 
      <string>inCommand icon57</string> 
      <key>UTTypeTagSpecification</key> 
      <string>Dictionary</string> 
      <key>public.filename-extension</key> 
      <string>icx</string> 
      <key>public.mime-type</key> 
      <array> 
       <string>application/inControl</string> 
      </array> 
     </dict> 
    </array> 

回答

0

我已經固定它 - 我發現,如果你不小心,當你使用UTExportedTypeDeclarations和CFBundleDocumentTypes的GUI條目,可以不按順序獲取字典內容 - 在我的情況下是UTTypeTagSpecification。我得出結論,最好將info.plist視爲源代碼並進行正確編輯。這裏是工作代碼:

<key>CFBundleDocumentTypes</key> 
    <array> 
     <dict> 
      <key>CFBundleTypeIconFiles</key> 
      <array> 
       <string>inCommand icon114</string> 
      </array> 
      <key>CFBundleTypeName</key> 
      <string>icx</string> 
      <key>CFBundleTypeRole</key> 
      <string>Editor</string> 
      <key>LSHandlerRank</key> 
      <string>Owner</string> 
      <key>LSItemContentTypes</key> 
      <array> 
       <string>com.ncbath.inControl.icx</string> 
      </array> 
     </dict> 
    </array> 


<key>UTExportedTypeDeclarations</key> 
    <array> 
     <dict> 
      <key>UTTypeConformsTo</key> 
      <array> 
       <string>public.data</string> 
      </array> 
      <key>UTTypeDescription</key> 
      <string>icx</string> 
      <key>UTTypeIdentifier</key> 
      <string>com.ncbath.inControl.icx</string> 
      <key>UTTypeSize320IconFile</key> 
      <string>inCommand icon114</string> 
      <key>UTTypeSize64IconFile</key> 
      <string>inCommand icon57</string> 
      <key>UTTypeTagSpecification</key> 
      <dict> 
       <key>public.filename-extension</key> 
       <string>icx</string> 
       <key>public.mime-type</key> 
       <string>application/x-inControl</string> 
      </dict> 
     </dict> 
    </array>