Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda