I have two versioned Data Models in my iOS project.
The difference between the Data Models is that newer model has a new field named "new_col".
In some part of the project, I need to fetch data filtered by this "new_col" field.
So, I used the following codes.
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"new_col = %@", val];
[request setPredicate:predicate];
NSArray *results = [context executeFetchRequest:request error:&err];
And I faced the exception - 'NSInvalidArgumentException', reason: 'keypath new_col not found in entity ...
I know that it's because of the original data model.
I think that I should convert the original data to the new data model.
How can I convert?