On 2013 Sep 16, at 08:53, Graham Cox wrote:
If I wanted to add some sort of progress reporting to archiving and dearchiving, what's a good way to do it? The problem seems to me to know what the 'count' of things read from/written to the file is to set the progress max value. Since the delegate gets called for each object instantiated, that part of it isn't a problem, I can just bump a counter. Counting the objects rather than actual bytes is probably as fine-grained as I need to get.

I'll bite. If you want to know the total number of objects to be archived, then you need to count them, at some time or another. To count them, you need to walk the object tree before you start actually archiving... which may take a significant fraction of the time it takes to archive.

Then, you could make sure it's the first thing that is archived, and hence the first thing unarchived... after which you can display/update the progress bar.

Yah, I know; ugly, but unavoidable as far as I know.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to