I am importing a large plist/XML into Core Data. The structure is simple: let's say there is Person and Company, and a Company can have many Persons. The import goes successfully, but the plist has no established relations, so duplicates of Company are inserted every time multiple people have the same Company.
A potential solution lies in Apple's Core Data docs under 'Implementing Find-or-Create Efficiently':
Or if you import "flat" data with no relationships, you can create managed objects for the entire set and weed out (delete) any duplicates before save using a single large IN predicate.
I've stared at this sentence for ages and can't parse it. Wasn't I already using managed objects to import the entire set? What fetch request are they alluding to?
An algorithm or clarification would be much appreciated.