gpt4 book ai didi

ios - 无法从 iOS Word 应用程序将 MS Word 文档复制到我的应用程序

转载 作者:搜寻专家 更新时间:2023-10-31 22:59:28 24 4
gpt4 key购买 nike

我想在我的应用程序的委托(delegate)函数中打开一个 Word 文件

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options

并添加到我的 Info.plist

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>doc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon.icns</string>
<key>CFBundleTypeName</key>
<string>Microsoft doc</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.word.doc</string>
</array>
</dict>
</array>

当我在 Google Inbox 应用程序中打开一封附有 Word 文档的电子邮件时,我会在文档交互 Controller 中看到我的应用程序,并且 Word 文件的副本会发送到委托(delegate)函数。

但是当我在 iOS Word 应用程序中打开 de Document Interaction Controller 通过点击最近文件列表中 Word 文件后面的“...”然后:“共享”>“发送副本”>“与另一个发送” app” 我的应用程序在文档交互 Controller 中不可见。

要在 iOS Word 应用程序的文档交互 Controller 中查看我的应用程序以在我的应用程序中编辑 Word 文件,我应该做更多或不同的事情吗?

最佳答案

看来您必须在 Info.plist 中提及 LSItemContentTypes 符合 org.openxmlformats.wordprocessingml.document 格式

所以 Info.plist 将变成:

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>doc</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>AppIcon.icns</string>
<key>CFBundleTypeName</key>
<string>Microsoft Word</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.word.doc</string>
<string>org.openxmlformats.wordprocessingml.document</string>
</array>
</dict>
</array>

关于ios - 无法从 iOS Word 应用程序将 MS Word 文档复制到我的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38962723/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com