Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - SDK - How do I open large keynote files in UIWebView?

I am trying to load a large Keynote file (~150MB) into a UIWebView and I keep getting memory warnings and my app crashes.

Is there a way around this?

What is the proper way to open files that are this large without opening them in another app?

like image 821
rplankenhorn Avatar asked Nov 11 '22 19:11

rplankenhorn


1 Answers

When you open a file in UIWebView directly from the url, the downloaded content is stored temporarily in RAM. The RAM is a shared space for the whole device, which has to perform other OS related tasks. Hence Your app is being killed by iOS due to memory pressure & resource crunch.

It is advisable to directly write your content into the file in NSDocumentsDirectory in background & load the file in UIWebView later.

With my knowledge I can suggest you the following.

The download Part

  • JGDownloadAcceleration A multipart Download Accelerator Library.
  • TCBlobDownload Competitive large files downloads for iOS

The Preview Part

  • CGPDF APIs Discussion
  • Another Discussion

Hope that helps.

like image 175
Balram Tiwari Avatar answered Nov 15 '22 06:11

Balram Tiwari