Picture a core data model with images in it. These images are stored in an object called OImage. There are several other objects that 'contain' images, so they all have a one to many relationship with the OImage object. One example is the OLocation object from the image.

As you can see, OLocation has a one to many relationship with OImage. Because there is no need for it, there is no inverse relationship from the OImage pointing back to OLocation. All according to plan.
Yet when I build my project, XCode keeps warning me about the lack of the inverse relationship:
OLocation.images -- to-many relationship does not have an inverse: this is an advanced setting (no object can be in multiple destinations for a specific relationship)
Is it illegal to create a one-to-many relationship without the inverse? Or is this warning something that I can somehow turn off?
Cheers, EP.
It is perfectly legal, but not often advisable to have a unidirectional relationship. This link explains this in more detail (from Core Data Programming guide).
You can however turn the warning off, by adding a new property to the build settings called MOMC_NO_INVERSE_RELATIONSHIP_WARNINGS and set its value to YES.
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