I have an in memory managed object context called importMoc that I use to import records (e.g. employees). I have parsed a file and set up the employee objects in importMoc with one very important exception. The user confirms they want to process %d employees but I can't quite figure out how or when to set the "parent" relationship of the employees (e.g. setting their department).
For my purposes they will all be imported into the same department (which the user has already implicitly selected).
Obviously I can't set up the relationships across the two contexts so do I:
- Create a department in importMoc and then when I merge changes merge the "import" department with the "real" department?
- 2) Merge the employees and then fetch all the freshly imported employees (somehow!!!) and set their department then?
- 3) Some other solution that I have overlooked?
It seems like a simple problem but for some reason (laziness? tiredness? stupidity?) I can't figure out how to go about it! Everything I've tried so far seems far too elaborate and complicated!
Thanks in advance!