Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

221
Views
How to handle a crash caused by a memory leak while using a PDFKit in iOS 12?

I am using pdfKit on CollectionViewController and each cell has a different PDF for it, and PDF will be downloaded from the document directory.

When I use the following code under iOS 11 then it works fine. However, when I use it on iOS 12, I get a memory leak and a subsequent crash.

This is the error I get:

Thread 4: EXC_BAD_ACCESS (code=1, address=0x107b5401c)

This is my code:

func loadData(_ finame: String) {
    let dbPath = finame
    let url = URL(fileURLWithPath: dbPath)
    if let pdfDocument = PDFDocument(url: url) {
        self.pdfView.document = pdfDocument
        self.pdfView.autoScales = true
        self.pdfView.maxScaleFactor = 4.0
        self.pdfView.minScaleFactor = pdfScaleFactor
        if #available(iOS 12.0, *) {
            self.pdfView.pageShadowsEnabled = false
        }
    }
}

How can I fix this problem?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!