this has beed discussed alot, but nothing that I found helped me... I just want to add a single attribute to a singe entity. Of cause without loosing my data.
To do that, I followed these steps
But I don't think it worked at all. There are no errors as long as not try to use the new attribute. But in my Core Data Model (when I open the .xcdatamodel in XCode) it's there and even in my NSManagedObject Subclass of the entity, the new attribute is there as a property. But when I try to use it, this happens:
unrecognized selector sent to instance 0x74f8520
or
the entity Name is not key value coding-compliant for the key "isFavoriteName".'
The key "isFavoriteName"is the one I just added.Like I said, I did all the steps. Do I miss something? I think, that the new Model Version is not being used, because when I delete some attributes in the Model, my app still works and the deleted information are still shown... I have set the current Core Data Model Version the the new one (Step 6).
I hope you can help me!
Nick
EDIT: Do I may have to change something in code as well? Apart from the setting the options when creating persistentStoreCoordinator... Because I have, let's say myApp.xdatamodel and inside of that, i know have myApp.xdatamodel and myApp 2,xdatamodel... but I my code I sill do:
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"myApp" withExtension:@"mom"];
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];