1

I'm getting a crash on my App Store update, the migration is handled and even when I see the code Block is being executed I get the Following migration error

'RLMException', reason: 'Migration is required for object type 'LLCachedObject' due to the following errors: - Property 'resultType' has been added to latest object model.'

This is how I'm handling the Migration

[migration enumerateObjects:LLCachedObject.className
                      block:^(RLMObject *oldObject, RLMObject *newObject) {
                          if (oldSchemaVersion < 5) {
                              newObject[@"resultType"] = kLLResultTypeBrief;
                          }
                      }];

and I double-checked that the oldSchemaVersion was 4, and newObject[@"resultType"] is being set properly, this is happening on iOS 9, I'm completely clueless as I've run out of things to checked to find out what is causing this.

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
Andrespch
  • 370
  • 3
  • 16
  • Are you setting the schema version to 5 in your RLMRealmConfiguration? Is it possible you're accessing the Realm before the migration block and schema version have been set in the configuration object? – jpsim Sep 21 '15 at 00:35

1 Answers1

1

So the problem turned out being that we have another project we use for the same app that also has a Realm, we weren't aware that the migration needed to be handled in both sides, so what we are doing now is using the class subsets to specify the Model Clases that every project uses.

For more details https://realm.io/docs/objc/latest/#class-subsets

Andrespch
  • 370
  • 3
  • 16