将 sqlite3 db 关联到 iPhone 应用程序 [英] Associating sqlite3 db to an iPhone app

查看:20
本文介绍了将 sqlite3 db 关联到 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 db 关联到 iPhone 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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