On Jul 22, 2019, at 8:56 AM, Steve Mills via Groups.Io <sjmills@...> wrote:
In my Core Data model, I've added a 2nd version with a new attribute. This attribute needs to be initialized to a sequential value upon migration from the old version. So I'm using a mapping model and a custom migration policy to set this new attribute's value on every entity object.
But, it's not sticking. Do I need to be doing something else in my performCustomValidationForEntityMapping:manager:error: method to cause the changes I've made to be saved? Or am I just interpreting the incredibly vague documentation for this method wrong?
for(Asset* ass in asses) { // ass.order = @(doc.nextAssetOrder); [ass setValue:@(doc.nextAssetOrder) forKey:AssetAttributes.order]; } }
return result; }
Do you call save on the context somewhere? I’ve not needed to use a mapping like this yet but it seems like if you’re changing attributes you’d want to save.