Reputation: 2306
I am getting the following error:
Terminating app due to uncaught exception 'RLMException', reason: 'Realm version is higher than the current version provided to `setSchemaVersion:withMigrationBlock:`'
How do I update the version provided to setSchemaVersion:withMigrationBlock?
Upvotes: 0
Views: 415
Reputation: 1447
You need to call:
[RLMRealm setSchemaVersion:newVersion withMigrationBlock:^{
// add migration code here
}];
before accessing any Realms.
If you have only made changes to your schema locally (ie you haven't yet shipped your app) you can instead simply delete your Realm files or the entire app from the simulator/device to reset everything.
The error message when hitting this error has been changed here:
https://github.com/realm/realm-cocoa/pull/1167
Upvotes: 1