I have an entity which looks like this:
Entityname = Country
with the attributes “city” and “person”.
Country *country = [NSEntityDescription insertNewObjectForEntityForName:@"Country" inManagedObjectContext:context];
country.city = @"New York";
country.person = @"Doug";
country.person = @"Carry";
country.person = @"Arthur";
I want to save more then one people in that City.
I am using the code posted above, but only the last person is saved.
How I can save more then one people in CoreData?
Hope you can help me.
An approach for solving your problem would be:
…
…
From this point is quite obvious to figure out how to add multiple objects 🙂
I know that all this may seem hard at first but once you get yourself into this you will really be able to manage complex object graphs easy and efficiently.
I hope that this information will set you on the right track!