Context:
The outcome:
CoreData: error: NSUnderlyingError = "Error Domain=NSCocoaErrorDomain Code=134110 \"An error occurred during persistent store migration.\"
UserInfo={
entity= TestModel,
attribute=new_one,
reason=Validation error missing attribute values on mandatory destination attribute}";
}
Solution:
I don't completely grasp why this happens (I'm too tired and eager to leave this problem behind), but the "mandatory destination attribute" thing pointed me in the direction of setting the property as an optional. Whether it's the right thing to do or just an ordinary hack...I don't know...but it solved my problem, I can now move on to the next
You've pretty much hit the nail on the head but it sounds like maybe you don't know why. It's because:
That leads directly to the error that you received.
You can fix this using any one of the following:
I think providing a default value is better than superfluous optionality.
Better to use optional only when a value is indeed optional.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With