How to set up a core data relationship between 2 classes with 2 different table views

In my swift code I have one class for cities and one class for states. States can have many cities but a city can only have 1 state. I don’t know if I set up my core data attributes correctly especially the inverse part. I know how to change it to one to many on the properties panel. I am just wondering if I am missing anything to do this.

I want it so, to selects a state and wants to save a city to that specific state.Create a new instance of City then Set the cityN attribute for new city.Set the state relationship of the new city to the selected state.

How do I do that?

This topic was automatically closed after 166 days. New replies are no longer allowed.