UIWebView loadData and iWork files

I am trying to open an iWork 10 Numbers file hosted on a website in UIWebView. I tried the following and it happens that the UIWebView loads empty. If I upload a file to the local Documents folder and then upload it to UIWebView, it works. I would like to read the iWork file without downloading them ...

FYI, I have no problems with PDF, PPT, DOC, XLS ...

Can someone tell me how to upload iWork file from NSdata to UIWebView?

[webView loadData:receivedData MIMEType:file.mediaMimetype textEncodingName:nil baseURL:[NSURL URLWithString:PATHTOFILE] ]; 

Tested values ​​for type mediaMimet:

  • application /vnd.apple.numbers
  • application / x-iwork-number-sffnumbers
+4
source share
1 answer

You need to compress the iWork file with the .zip extension to display in webview.

See this link for more details:

http://developer.apple.com/library/ios/#qa/qa1630/_index.html

0
source

Source: https://habr.com/ru/post/1341018/


All Articles