• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using NSProgress with NSURLSessionDownloadTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSProgress with NSURLSessionDownloadTask


  • Subject: Using NSProgress with NSURLSessionDownloadTask
  • From: Daryle Walker <email@hidden>
  • Date: Thu, 09 Apr 2015 03:37:03 -0400

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 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Using NSProgress with NSURLSessionDownloadTask
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Get a NIL NSError object for second download task
  • Next by Date: Re: Using NSProgress with NSURLSessionDownloadTask
  • Previous by thread: Re: Get a NIL NSError object for second download task
  • Next by thread: Re: Using NSProgress with NSURLSessionDownloadTask
  • Index(es):
    • Date
    • Thread