无法从 UIDocumentPickerViewController ios swift 获取 .doc 文件

Posted

技术标签:

【中文标题】无法从 UIDocumentPickerViewController ios swift 获取 .doc 文件【英文标题】:Not able to get .doc file from UIDocumentPickerViewController ios swift 【发布时间】:2017-05-12 14:26:40 【问题描述】:

我正在使用此代码在我的应用程序中从 iCloud 获取文档。

let documentPicker: UIDocumentPickerViewController = UIDocumentPickerViewController(documentTypes: ["public.content","public.data"], in: UIDocumentPickerMode.import)
    documentPicker.delegate = self
    documentPicker.modalPresentationStyle = UIModalPresentationStyle.fullScreen
    if let popoverPresentationController = documentPicker.popoverPresentationController 
      popoverPresentationController.sourceView = sender
    

    self.present(documentPicker, animated: true, completion: nil)

我想要来自 iCloud 的三种类型的文档,即 .pdf、.doc、.docx。我可以从 icloud 获取 PDF 文件,但不能获取 .doc 文件 我正在为文件类型(即“public.content”、“public.data”)提供适当的 UTI。这些尿路感染在页面上给出 apple Documentation。 public.data 确认 doc 文件,但我仍然无法获取 doc 文件。

【问题讨论】:

【参考方案1】:

根据this,您必须将 com.microsoft.word.doc 用于文档类型 希望它有效。

【讨论】:

这没有提供问题的答案。一旦你有足够的reputation,你就可以comment on any post;相反,provide answers that don't require clarification from the asker. - [来自评论] (***.com/review/late-answers/17657874)

以上是关于无法从 UIDocumentPickerViewController ios swift 获取 .doc 文件的主要内容,如果未能解决你的问题,请参考以下文章

无法从资源加载位图

为啥我无法从 Alamofire 获取请求结果

DateTimeParseException:无法解析文本:无法从 TemporalAccessor 获取 LocalDateTime

无法从 'char[]' 转换为 'string[]' [关闭]

无法远程调试应用程序 - 端口无法从外部访问

无法从状态 '' 解析 '...'