0

My app generates reports for business and one option allows the user to view all the invoices in the app.

The app was working fine until now. As the data in the app grows, the reports become larger in size. Currently, the report has stopped displaying. I am using UIDocumentInteractionController to view the generated PDF reports.

I initially recorded Received memory warning. messages in console. However, I eliminated that by setting the array that holds the data for PDF to nil.

Now, when I run the app via Xcode, the app loses connection when the UIDocumentInteractionController shows up. When opening the app without xcode, the controller shows a black screen for a moment and then shows the size of the file (47MB) with the file name (Preview.PDF). It does not show the document.

How do I fix this issue?

I am using iPad 2 for work.

Thanks.

Gaurav Wadhwani
  • 1,352
  • 2
  • 15
  • 32
  • Could you please add some more details about how do you get PDF file inside your app? Is it downloaded from server or it's an HTTP URL etc – Roman Dec 25 '14 at 12:10
  • @Roman the file is generated from within the app. The data is stored in the app via Core Data and the app generates PDF reports based on that data. – Gaurav Wadhwani Dec 25 '14 at 12:23
  • 1
    Have you checked whether PDF file generated by your app can be opened with preview app on mac? – Roman Dec 25 '14 at 12:25
  • @Roman the app generated the PDF and opens it in the Simulator properly. I also copied the file and the preview app opens it as well. So, am guessing its related to memory on iOS devices. – Gaurav Wadhwani Dec 25 '14 at 12:27
  • @Guarav I had a problem in iOS app on iPad 2 that was not able to keep in memory PDFs larger than 30 MBs, I suppose you have similar problem. Solution is not simple - try to decrease memory footprint using Leaks instrument. – Roman Dec 25 '14 at 15:28
  • How did you resolve that? You can't ask the user to upgrade their iPads right.. – Gaurav Wadhwani Dec 25 '14 at 15:29
  • As I mentioned in previous comment - I've managed to reduce memory footprint and make sure that application eats less RAM. In my case problem was with PDF downloads from server that instead of stored to file storage were kept in-memory. – Roman Dec 25 '14 at 15:32

0 Answers0