I have a model graph, where there is several entities that have one to many relationship with other entity.
It means that inverse relationship should be one to many, but that is impossible.
The core data works well without inverse relationship; the only thing that drives me crazy is warnings:
Entity should have an inverse relationship
Does anybody know how to avoid these specific warnings?
Inverse Relationships
Most relationships are inherently bi-directional. If a Department has a to-many relationship to the Employees that work in a Department, there is an inverse relationship from an Employee to the Department. The major exception is a fetched property, which represents a weak one-way relationship—there is no relationship from the destination to the source (see “Fetched Properties”).
You should typically model relationships in both directions, and specify the inverse relationships appropriately. Core Data uses this information to ensure the consistency of the object graph if a change is made
Reference in Apple documentation
As a general rule, a one-to-many relation has a many-to-one inverse. In case you want to define a many-to-many relationship, you simply define one relation as to-many and its inverse as a to-many as well.
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