Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

220
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda