I’m inserting hundreds of thousands of objects using NSBatchInsert, now i want to add relationships between objects (let say A and B, with 1-to-many relationship) as no batch operation supports relationship i will need to use the most efficient and fast way to achieve what I want, the best way I could think of is to use “GroupBy” to fetch object, but this will lead to start a loop to fetch the A entity (as the Key of the Dictionary will be a property not an object).
is there any way to have a Dictionary as fetch result having as Key an NSManagedObject (the A object) and the value an Array of NSManagedObject (B objects) ?
-> let result: [A: [B]]
Thank you
4