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

179
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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