Realm Blog

Realm Cocoa 0.90

We just pushed a Realm Objective-C update to this website and to CocoaPods. Here’s what’s new!

Per-path Schema Migrations

Schema versions and migration blocks are now set for individual paths rather than having a single global one for all Realms. This change improves working with multiple Realms which store different types of data. If you’re only using the default Realm, you’ll need to switch from calling +[RLMRealm setSchemaVersion:withMigrationBlock:] to calling +[RLMRealm setDefaultRealmSchemaVersion:withMigrationBlock:]. Migration blocks for other Realms can be set with +[RLMRealm setSchemaVersion:forRealmAtPath:withMigrationBlock:].

We’ve also made improvements to schema migrations so that if any errors occur, the write transaction is cancelled rather than committed, so bugs in your migration code are less likely to leave the Realm in a hard-to-recover state.


Realm uses several temporary files which are normally not flushed to disk but theoretically could be under heavy memory pressure, so all temporary files which contain any potentially sensitive information are now encrypted along with the main .realm file.

We’ve added -[RLMRealm writeCopyToPath:encryptionKey:error:], which lets you write a copy of the Realm with a different encryption key than the key which was used to open the file.

+[RLMRealm encryptedRealmWithPath:key:readOnly:error:] is now +[RLMRealm realmWithPath:encryptionKey:readOnly:error:] for better consistency with the rest of our API.


Comparing two string columns in a query is now supported (e.g. [ModelObject objectsWhere:@"stringProp1 == stringProp2"]), and we’ve fixed a bug that could result in incomplete results when querying with NOT or for non-nil relationships.

Crash fixes

Thanks to everyone who has emailed us crash reports! They really do help us track down problems in Realm.

  • Fixed a crash in JSONImport example on OS X with non-en_US locale.
  • Fixed a crash when adding primary keys to older realm files which had no primary keys defined for any classes.
  • Fixed a crash when removing a primary key from an existing Realm file in a migration.
  • Fixed a crash when multiple write transactions with no changes followed by a write transaction with changes were committed without the main thread RLMRealm getting a chance to refresh.
  • Fixed a crash or infinite loop when a file is opened in both a 32-bit simulator and the Browser at the same time (note that opening a Realm file in multiple processes at once is not yet fully supported).

Thanks for reading. Now go forth and build amazing apps with Realm! As always, we’re around on the mailing list, Stack Overflow, GitHub, and Twitter.

Realm Team

At Realm, our mission is to help developers build better apps faster. We provide a unique set of tools and platform technologies designed to make it easy for developers to build apps with sophisticated, powerful features — things like realtime collaboration, augmented reality, live data synchronization, offline experiences, messaging, and more.

Everything we build is developed with an eye toward enabling developers for what we believe the mobile internet evolves into — an open network of billions of users and trillions of devices, and realtime interactivity across them all.

Get more development news like this