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
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.
-[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.
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
- 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).