Master data (after adding a unique constant): annotation: fixing a missing distribution spread for to-many relationships

This problem occurred after adding the unique key i.es Constraint.

Frequently updating a Meeting control object removes an event-driven object that is one-to-one from the meeting managed object.

CoreData error: annotation: fixing a missing distribution spread to map to-manyList relationships on object 0x60c0009c4d0 (0x60c000621e40) with bad error 0x60800009ac20 (0x60800023a360)

Data model

I have three objects in my underlying i.es data model

(CDEvent, CDMeeting, CDMLCheckin) . 

Entity properties and relationships, as described below:

Relationship enter image description here

Properties: CDEvent enter image description here CDMeeting enter image description here

CDMLCheckin enter image description here

Unique limitation:

  • The CDEvent object has eventUUID as a unique constraint.
  • The CDMeeting object has meetingUUID as a unique constraint.

Relationship

  • CDEvent โ†”> CDMeeting
    • From CDEvent to CDMeeting , a many-to-many relationship with a cascade of deletion rules, feedback from CDMeeting with CDEvent is one thing with canceling the deletion rule.
  • CDEvent โ†”> CDMLCheckin
    • From CDEvent to CDMLCheckin , a many-to-many relationship with a cascade of deletion rules, feedback from CDMLCheckin on CDEvent is one, with the deletion rule being canceled.

Full description: https://docs.google.com/document/d/1y2DQhBBLqjAP9eWbx5YpQhH7oVigxT_mcJDnPLlOMtQ/edit?usp=sharing

Note

  • If I remove Unique Constraint eventUUID from CDEvent , everything works fine.

Please help us here, as we are amazed after more than a week :(

+7
ios objective-c ios9 core-data unique-constraint
source share
1 answer

I hope I can help, having a unique limitation with To-Many Relationship Entities, you need to remember some points.

  • Use feedback for every relationship CoreData li>
  • Unique Constrains Attributes Should Never Be Optional

When creating an NSManagedObjectContext, make sure you set MergePolicy.

[_ context setMergePolicy: mergePolicy];

  • NSMergeByPropertyStoreTrumpMergePolicy

  • NSMergeByPropertyObjectTrumpMergePolicy

  • NSOverwriteMergePolicy

Also, can you try changing the nullify deletion rule without any action?

+2
source share

All Articles