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

169
Vistas
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 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