如何将CSV文件关联到我在iOS 7中的应用程序 [英] How to associate CSV file to my app in iOS 7

查看:287
本文介绍了如何将CSV文件关联到我在iOS 7中的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我逐行跟着这两个教程,尝试将我的应用程序与csv文件(电子邮件应用程序附件)关联,我添加了这些下面的更改到我的应用程序的plist文件,然后构建我的应用程序,并运行我的设备(iPhone 4,iOS 7.0.4),没有任何反应,我的意思是当我点击电子邮件中的.csv文件,我的应用程序仍然没有出现在开放的可用应用程序列表中,我只是不知道我在哪里做错了,或者iOS 7有不同的方式做这个?

I followed these two tutorials line by line, try to associate my app to the csv file (email app attachment), but I after I added these down below changes to my app's plist file, then build my app and run it my device (iPhone 4, iOS 7.0.4), nothing happens, I mean when I clicked on the .csv file in the email, my app still does not show up in the open-in available application list, I just don't know where I did wrong, or iOS 7 has different way doing this?

< a href =http://blog.spritebandits.com/2011/12/14/importing-csv-data-file-into-an-ios-app-via-email-attachment/ =noreferrer> http ://blog.spritebandits.com/2011/12/14/importing-csv-data-file-into-an-ios-app-via-email-attachment/

http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email -in-your-ios-app

这是我的plist更改(添加的新条目后面是教程)看起来像:

this is what my plist changes (the new entries added followed by the tutorial) looks like:

>

这是应用程式设定画面:

here's the app setting screen:

这里是xml版本:

        <key>CFBundleDocumentTypes</key>
        <array>
            <dict>
                <key>CFBundleTypeName</key>
                <string>CSV Document</string>
                <key>LSHandlerRank</key>
                <string>Owner</string>
                <key>CFBundleTypeRole</key>
                <string>Viewer</string>
                <key>LSItemContentTypes</key>
                <array>
                    <string></string>
                </array>
            </dict>
        </array>
        <key>UTExportedTypeDeclarations</key>
        <array>
            <dict>
                <key>UTTypeDescription</key>
                <string>CSV Document</string>
                <key>UTTypeConformsTo</key>
                <array>
                    <string>public.data</string>
                </array>
                <key>UTTypeIdentifier</key>
                <string>Damian-s.${PRODUCT_NAME:rfc1034identifier}</string>
                <key>UTTypeTagSpecification</key>
                <dict>
                    <key>public.filename-extension</key>
                    <string>csv</string>
                    <key>public.mime-type</key>
                    <string>application/inventorytodo</string>
                </dict>
            </dict>
        </array>


推荐答案

c $ c> CFBundleDocumentTypes 定义:

You're missing the UTI type in your CFBundleDocumentTypes definition:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>CSV Document</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSItemContentTypes</key>
        <array>
            <string></string>
        </array>
    </dict>
</array>

应为:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>CSV Document</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>Damian-s.${PRODUCT_NAME:rfc1034identifier}</string>
        </array>
    </dict>
</array>

这篇关于如何将CSV文件关联到我在iOS 7中的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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