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

168
Visualizações
iOS Attempted to dereference garbage pointer

I am getting iOS crash report from Bugnag:

Attempted to dereference garbage pointer 0x8000000000000010

Below is the class which I have in my project

class Presence {
    private var userStates = [Int: [String: Any]]()

   internal func saveState(state: UserPresenceState, updateTime: Date, for userId: Int) {
        let value = ["state": state, "updated_at": updateTime]
        let queue = DispatchQueue(label: "mySerialQueue")
        queue.sync { 
             self.userStates[userId] = value
        }
    }
}

I am getting Attempted to dereference garbage pointer at line self.userStates[userId] = value. Not sure while accessing self or while accessing userStates variable

I am not sure why this is happening and unable to replicate it, how to solve these kinds of problems?

Is there anything know whether a variable is deallocated or not?

Any help much appreciated

FYI I got the same error from bugsnag with below code too

internal func saveState(state: UserPresenceState, updateTime: Date, for userId: Int) {
    let value: [String: Any] = ["state": state, "updated_at": updateTime]
    self.userStates[userId] = value
}
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