在 iOS 上添加与 tiff 文件的文件关联
我想在我的 iOS 应用程序中创建一个与 tiff 文件关联的文件(即,以便我的应用程序显示为从 Mail 或 Safari 打开 tiff 文件的目标)。将以下内容添加到我的 Info.plist 文件似乎不起作用:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>tiff</string>
<key>LSItemContentTypes</key>
<array>
<string>public.tiff</string>
</array>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
</array>
我有一个应用程序,我以相同的方式与 PDF 关联,并且工作正常。我认为不可能将应用程序与 iOS 上的 tiff 文件类型关联起来,但我找不到任何说明这一点的文档。
有没有其他人有幸让它发挥作用或找到明确的“不,你不能这样做”?
I'd like to create a file associate with tiff files in my iOS app (i.e. so that my app appears as a target for opening tiff files from Mail or Safari). Adding the following to my Info.plist file doesn't seem to work:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>tiff</string>
<key>LSItemContentTypes</key>
<array>
<string>public.tiff</string>
</array>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
</array>
I have an app that I associate with PDFs in the same way and it works fine. I believe that it is not possible to associate an app with the tiff file type on iOS, but I can't find any documentation stating that.
Has anyone else had luck getting this to work or finding a definitive "no, you can't do that"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我为此烧了一个Apple TSI(反正我似乎从来没有使用过它们),官方的答案是:不,你不能这样做。
我已在 Apple 的错误报告网站上记录了增强请求: http://developer.apple.com/bugreporter/< /a> 如果这个问题对您来说是个问题,我建议您也这样做。
I burned an Apple TSI on this (I never seem to end up using them anyway) and the official answer is: no, you can't do that.
I've logged an enhancement request on Apple's bug reporting site: http://developer.apple.com/bugreporter/ and I suggest you do too if this issue is a problem for you.
Acorn 声明了 TIFF 的文件关联,这似乎工作正常。
我可以看到 Acorn 的实现与您的实现之间的唯一区别是 Gus 省略了 CFBundleTypeName 并添加了 LSIsAppleDefaultForType (设置为 true)。您可能想尝试一下。
LSIsAppleDefaultForType 未记录。这里有一个参考:http://lists.apple。 com/archives/cocoa-dev/2006/Jun/msg00747.html
Acorn declares file associations for TIFFs, which seems to work fine.
The only differences I could see between Acorn's implementation and yours is that Gus omits CFBundleTypeName and adds LSIsAppleDefaultForType (set to true). You might want to give that a try.
LSIsAppleDefaultForType is undocumented. There's a reference to it here: http://lists.apple.com/archives/cocoa-dev/2006/Jun/msg00747.html
一般说明 - Mail 和 Safari 应用程序确实不允许您“使用 .. 打开”tiff 文件(在 iOS8 中仍然如此);
尽管如此,许多其他应用程序(例如 Dropbox、GDrive 等)确实允许您执行此操作。
An general note - the Mail and Safari apps indeed does not allow you to "open with .." tiff files (still true in iOS8);
Nevertheless, a lot of other apps, such as Dropbox, GDrive, etc, does allow you to do that.