By example:
I have an entity User
, and an entity Device
.
User
have a To Many relationship toward Device
, called devices
.
Device
has the inverse of this relationship called user
.
Now I collect, persist a bulk of devices from e.g. a network service, hydrate them into an NSSet
, then I bound them to a particular user, so I do:
NSSet *collectedDevices = [API getSomeDevices];
someUser.devices = collectedDevices;
Will Core Data populate the inverse user
relationship for each Device
for me? Does it observe the setters for relationships?
Background:
I'm aware of the Core Data setters for setting collections, but I want to avoid using them. I'm actually reconstructing Core Data entities from JSON representations with KVC without hardcoded attributes, relationships, just enumerating their entity descriptions, and set matching values.