Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!