NSProgress, one of those APIs too new to be well used. Does anyone know how to use it with a downloading task?
Actually I have an array of potential tasks. So I guess I make an outer progress, then in the loop creating the tasks, I create the per-task progresses while the outer one is in a parent block.
For the per-task progresses, I guess I need ones for downloading, moving the file to a scratch directory on the destination volume, then replacing/moving it again to the final destination. So that would mean a top-level task progress, and three secondary ones.
One problem is that it’s a secret which API groups support NSProgress. I read that the NSURLSession family doesn’t, so I guess I would manually call the NSProgress methods during the download percentage callback. But I don’t know if NSFileManager supports NSProgress, nor where to insert manual calls if it doesn’t. (I currently don’t use a NSFileManager delegate.)
(I know the problem is half here, and half the general Cocoa list, but I wanted to keep all the related questions together.)
(The actual final goal is to make a command-line progress bar, somehow, and link it to the NSProgress tree here. Are there any C or Objective-C CLI progress-bar libraries out there? I know there are helper whole-programs. Or is this a new open-source library itself?)
— Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
|