UIWebView Frame load interrupted

来源:互联网 发布:网络报警中心 编辑:程序博客网 时间:2024/06/05 15:22

Error Domain=WebKitErrorDomain Code=102 UserInfo=0x145bc10 "Frame load interrupted"
http://whatineedis.info/uiwebview-frame-load-interrupted/

Had this strange issue where when I tried to load a cached file into the UIWebView on iOS it chucked up this error, more strange as I knew the file was sound as I was previously opening it in a UITextView.

The I stumbled across this

http://stackoverflow.com/questions/1482736/frame-load-interrupted-error-while-loading-a-word-document-in-uiwebview

It appears as though the UIWebView chokes when trying to open a document without a file extension, it makes some sense for a stripped down UIWebView to employ this tactic to file recognition even if it is reminiscent of the early 90′s. The solution was to add .html on to the end of the cached file, and voila.



http://developer.apple.com/iphone/library/qa/qa2008/qa1630.html


In addition to HTML content, UIWebView can display specific document types.

iPhone OS 2.2.1 supports the following document types:

  • Excel (.xls)

  • Keynote (.key.zip)

  • Numbers (.numbers.zip)

  • Pages (.pages.zip)

  • PDF (.pdf)

  • Powerpoint (.ppt)

  • Word (.doc)

iPhone OS 3.0 supports these additional document types:

  • Rich Text Format (.rtf)

  • Rich Text Format Directory (.rtfd.zip)

  • Keynote '09 (.key)

  • Numbers '09 (.numbers)

  • Pages '09 (.pages)