How to Using ASIHTTPRequest to tracking Upload/Download progress
I got some question is using ASIHTTPRequest to tracking Upload/Download progress
This is the sample from 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 deprecated NSProgressIndicator
So … how can I know the Upload/Download progress ???
Also another question is …if the Upload/Download was terminated before the task finish
How can I let the Upload/Download task continues start from the stop point(break point?) ?
Many thanks ~
2 Solutions Collect From Internet About “How to Using ASIHTTPRequest to tracking Upload/Download progress”
As the documentation says, the delegate can also be an UIProgressView in case of iphone/ipad:
Each ASIHTTPRequest has two delegates
that can be used for tracking progress
– downloadProgressDelegate (for downloads) and uploadProgressDelegate
Progress delegates can be
NSProgressIndicators (Mac OS X) or
ASIHTTPRequest will automatically
cater for the differences in the
behaviour of these two classes. If you
want, you can also use a custom class
as a progress delegate, as long as it
responds to setProgress:.
- If you are performing a single
request, you set an upload and/or
download progress delegate on that
- If you are performing multiple
requests in a queue, and you want to
track overall progress for all
requests in the queue, use a
ASINetworkQueue and set the progress
delegate of the queue
- If you want to
do both of these at the same time,
this is possible too (as of v0.97)
Only certain methods of NSProgressView are deprecated. Specifically
-setAnimationDelay. They changed how you use the class, they didn’t deprecate the whole class.
Also, with the tags you chose for your question, you probably want
UIProgressView, which is the iPhone version.
- multipart PUT request using AFNetworking
- How do I limit an iOS app only to 4 inch screen devices?
- Type 'Any' Has no Subscript Members in xcode 8 Swift 3
- iOS 5.1 and Xcode 4.3.1 CodeSign Error
- Understanding Swift argument notation in functions like tableView
- finding a point on a path
- Simply mask a UIView with a rectangle
- iOS 6 MFMailComposeViewController: Only support RGBA or the White color space, this method is a hack
- Xcode 6.4 – Autocomplete Doesn't Show Type Symbols
- UIView drag (image and text)
- Setting interval value for UISlider
- Crashlytics not reporting crash in Release mode
- iPhone: NSDate convert GMT to local time
- RealmSwift : required public init() error
- xcode duplicate symbols for architecture error after updating cocoa pods