I am inserting tons of of 1000’s of objects utilizing NSBatchInsert, now i need to add relationships between objects (let say A and B, with 1-to-many relationship) as no batch operation helps relationship i might want to use probably the most environment friendly and quick approach to obtain what I need, the easiest way I might consider is to make use of “GroupBy” to fetch object, however it will result in begin a loop to fetch the A entity (because the Key of the Dictionary shall be a property not an object).
is there any approach to have a Dictionary as fetch outcome having as Key an NSManagedObject (the A object) and the worth an Array of NSManagedObject (B objects) ?
-> let outcome: [A: [B]]
Thanks