【问题标题】:NSRangeException while opening local .doc files on webview在 webview 上打开本地 .doc 文件时出现 NSRangeException
【发布时间】:2011-11-25 05:06:02
【问题描述】:

我正在尝试在 iPad 上的 UIWebview 中打开下载的 .doc 文件。 基本上 .doc 文件在我试图打开的文件名和文件内容中都有 unicode 字符。

我在控制台中收到以下错误日志

WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSRangeException> *** -[NSArray objectAtIndex:]: index 0 beyond bounds for empty array

但是 webview 的 didFailLoadWithErrorwebViewDidFinishLoad 委托都没有被调用,所以我该如何捕获错误。这可能是什么原因?

【问题讨论】:

    标签: ios exception unicode uiwebview uiwebviewdelegate


    【解决方案1】:

    我以前在这里看到过一些这样的问题。

    如:

    Displaying ppt, doc, and xls in UIWebView doesn't work but pdf does

    UIWebView does not open ms word (doc) and ms excel (xls) files

    您可能会在这些问题中找到一些有用的提示。

    在 Macintosh 上下载文件时是否正确打开?

    mime 类型设置是否正确?

    您在 UIWebViewDelegate 中还实现了什么?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-19
      • 2013-10-07
      • 2012-07-21
      • 1970-01-01
      相关资源
      最近更新 更多