small medium large xlarge

Back to: All Forums  Core Data
17 Aug 2010, 18:08
Jonathan D Schmidt (4 posts)

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:

  1. Select Export menu item.
  2. Pop up list of objects to export.
  3. User selects each object to export.
  4. User clicks export button.
  5. Directory selection dialog comes up.
  6. User selects the directory to export to.
  7. 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!


You must be logged in to comment