将sqlite3数据库与iPhone应用程序相关联 [英] Associating sqlite3 db to an iPhone app

查看:126
本文介绍了将sqlite3数据库与iPhone应用程序相关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将SQLite3数据库文件与我们的应用程序相关联,以便从电子邮件中轻松打开备份数据库。但是,以下情况似乎不起作用,因为Mail仍无法识别该文件(在iPad和iPhone 4上):

I'm trying to associate an SQLite3 database file with our app so that it's easy to open backed up database from an email. The following however does not seem to work as Mail still doesn't recognizes the file (on an iPad and iPhone 4):

<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.database</string>
            <string>public.data</string>                    
        </array>
        <key>UTTypeDescription</key>
        <string>App Database File</string>
        <key>UTTypeIdentifier</key>
        <string>com.company.App.db</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <string>db</string>
            <key>public.mime-type</key>
            <string>application/x-sqlite3</string>            
        </dict>
    </dict>
</array>

 <key>CFBundleDocumentTypes</key>
 <dict>
  <key>CFBundleTypeName</key>
  <string>App Database</string>
  <key>CFBundleTypeIconFiles</key>
  <array>
   <string>Icon-Small.png</string>
   <string>Icon.png</string>
  </array>
    <key>CFBundleTypeRole</key>
        <string>Editor</string>

  <key>LSItemContentTypes</key>
  <array>
   <string>com.company.App.db</string>
  </array>
  <key>LSHandlerRank</key>
  <string>Alternate</string>
 </dict>
</dict>

我知道我做错了吗?

推荐答案

好的我已经把它排除了。如果您改为使用目标信息面板并在那里添加文档类型(然后选择SQLite作为类型')它就可以正常工作。显然,如果你已经导出了上面的类型。

Okay I've sorted this out. If you instead use 'target's info' panel and add your document type there (and then select 'SQLite' as the type') it just works. Obviously provided you've exported the type as above.

这篇关于将sqlite3数据库与iPhone应用程序相关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆