How to use ASIHTTPRequest to track upload / download

I have questions: use ASIHTTPRequest to track upload / download.

This is a sample from the ASIHTTPRequest website.

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDownloadProgressDelegate:myProgressIndicator]; [request startSynchronous]; NSLog(@"Max: %f, Value: %f", [myProgressIndicator maxValue],[myProgressIndicator doubleValue] 

It says: myProgressIndicator is an NSProgressIndicator.

But it looks like Apple has deprecated the NSProgressIndicator

Check here

So ... how can I find out about the progress of upload / download ???

The question also arises: if the download / download was completed before the task was completed

How can I let a load / load task continue from a breakpoint (breakpoint?)?

Thanks a lot ~

+6
ios objective-c iphone uiprogressview
source share
2 answers

As the documentation says, the delegate can also be a UIProgressView in the case of iphone / ipad:

Each ASIHTTPRequest has two delegates that can be used to track progress - downloadProgressDelegate (for download) and uploadProgressDelegate (for download).

Process participants can be NSProgressIndicators (Mac OS X) or UIProgressViews (iPhone). ASIHTTPRequest will automatically take into account differences in the behavior of these two classes. if you want, you can also use a custom class as a progress delegate if it responds to setProgress :.

  • If you are executing a single request, you set the download and / or download delegate to progress on this issue request
  • If you are running multiple requests in the queue and you want to track the overall progress for all requests in the queue, use ASINetworkQueue and set the progress to the delegate queue
  • If you want both at the same time, this is also possible (starting from v0.97)

source: http://allseeing-i.com/ASIHTTPRequest/How-to-use#tracking_progress

+5
source

Only certain NSProgressView methods are deprecated. In particular, -animate , -animationDelay and -setAnimationDelay . They changed the way the class was used, they did not invalidate the whole class.

Also, with the tags you have chosen for your question, you will probably want UIProgressView , which is a version of the iPhone.

+1
source

All Articles