I ran into this warning and problem! Here is what you need to know ...
Let's say you have two tables - Cars and Drivers. You define a one-to-one relationship - one car to one driver, but not the opposite.
So, if you create a car and assign a driver to it, if you delete the driver later, and then try and get access to car.driver, your program will fail. Car.driver will not be nil - this will cause your program to crash.
So, if you do not create an inversion, you can never check if there is something, and you canโt even work without problems with car.driver in general if the driver has been removed.
I don't like how Xcode has this setting. It should invert by default and be a pain in the ass to change it.
Inversion setup is simple. Just open your xcdatamodel in Xcode, click on the existing ratio and check the reverse field.
source share