首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS7自定义UTI

iOS7自定义UTI
EN

Stack Overflow用户
提问于 2013-10-24 15:03:54
回答 1查看 2.1K关注 0票数 1

我的头撞在墙上,但似乎无法使我的习惯实用。

我正在努力让AirDrop在我的应用程序中实现,这样我就可以在设备之间共享文件。我能够成功地传输其他设备的文件,但是安装了我的应用程序的其他设备不会打开我的应用程序中的文件。

下面是我的app.plist的转储:

代码语言:javascript
复制
    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>MYAPP</string>
    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array>
                <string>57x57</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>MYAPPNAME Shared Assignment</string>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>LSHandlerRank</key>
            <string>Owner</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.MYAPPNAME.SIAASSIGNMENT</string>
            </array>
        </dict>
    </array>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIcons</key>
    <dict>
        <key>CFBundlePrimaryIcon</key>
        <dict>
            <key>CFBundleIconFiles</key>
            <array>
                <string>57x57 2.png</string>
                <string>114x114 2.png</string>
                <string>72x72 2.png</string>
                <string>144x144 2.png</string>
            </array>
        </dict>
    </dict>
    <key>CFBundleIdentifier</key>
    <string>com.MYAPPNAME.${PRODUCT_NAME:rfc1034identifier}</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>4.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>4.0</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSMainNibFile</key>
    <string>Main_Window</string>
    <key>NSMainNibFile~ipad</key>
    <string>Main_Window_iPad</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>fetch</string>
        <string>remote-notification</string>
    </array>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIStatusBarTintParameters</key>
    <dict>
        <key>UINavigationBar</key>
        <dict>
            <key>Style</key>
            <string>UIBarStyleDefault</string>
            <key>Translucent</key>
            <false/>
        </dict>
    </dict>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UTExportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.text</string>
            </array>
            <key>UTTypeDescription</key>
            <string>MYAPPNAME Shared Assignment</string>
            <key>UTTypeIdentifier</key>
            <string>com.MYAPPNAME.SIAASSIGNMENT</string>
            <key>UTTypeSize320IconFile</key>
            <string>72x72</string>
            <key>UTTypeSize64IconFile</key>
            <string>57x57</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>com.MYAPPNAME.SIAASSIGNMENT</key>
                <array>
                    <string>SIAASSIGNMENT</string>
                                <key>public.mime-type</key>
                                <string>application/xml</string>
                </array>
            </dict>
        </dict>
    </array>
</dict>
</plist>

我尝试过很多不同的方法来完成这个工作,我只是无法让iOS7认识到这是我的文件类型。我知道您不应该为UTI使用'public.xxx‘名称空间,因为这些名称空间是由苹果预先分配的。任何帮助都将不胜感激!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-24 15:56:23

确保您的将类型声明为导入,以便iOS知道显示您的应用程序,作为打开它们的一个选项。

此外,请确保实现-application:openUrl:sourceApplication:annotation:以通过AirDrop或文档交互控制器接收文件。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19569612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档