I’m a big fan of your book and you have helped so much! I am working on my app and I need to be able to export each individual object (with associated objects) to an individual file. I’m struggling to find the best place to do this. From the user perspective, here is what I want it to do:
- Select Export menu item.
- Pop up list of objects to export.
- User selects each object to export.
- User clicks export button.
- Directory selection dialog comes up.
- User selects the directory to export to.
- App then exports each object to individual XML files.
I don’t think I have any problems with 1-6. 7 is the problem. I can’t figure out the best place to handle this. From a multi-tasking standpoint, is it acceptable to add one operation to the command queue for each object to be exported? My concern is that this could cause a problem once I hit tens or even hundreds of objects. That’s a lot of operations. Will OS X be fine with this?
The other idea I had is to modify the PPExport class to export each individual ObjectID to its own file, but this seems overly complicated. I would have to create individual PersistentStores for each object. It would require a lot of modification to the class.
Of course, the easiest apparent way is to take the multi-tasking out of the picture altogether and simply iterate through the array to export each object, but that defeats the purpose of having multi-tasking in the first place.
Any advice is appreciated!