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

177
Vistas
Does In-Memory Realm have the copy of disk persisted Realm data in Swift?

Just trying to understand, when we try to access an object using an in-memory realm instance, does it replicate the disk persisted realm data at that moment or will it be a clean realm instance with no data in the objects.

I do understand that both the realm instances point to the same object schema but still confused.

I have both disk-persistence and in-memory realm in my project.

When I try to query the disk-persisted realm the data objects are returned if exists while on the other hand the if I perform the same query on in-memory realm it always returns 0 objects.

Any help would be appreciated.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The in-memory Realm will be a clean Realm instance. It does not interfere with any other realm (on-disk or elswhere). All entries will be gone, once your application is terminated.

You can even have multiple in-memory Realms running at once, e.g. to have a clean database for each unit test class. Just make sure you use a different inMemoryIdentifier for each test.

var config = Realm.Configuration()
config.inMemoryIdentifier = self.name // use the test class name as identifier

let realm = try Realm(configuration: config)
return realm
over 4 years ago · Santiago Trujillo Denunciar
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