iPhone Download Meter
Hi i have plan to develop app similar to http://itunes.apple.com/app开发者_如何学JAVA/download-meter-for-wi-fi-3g/id327227530?mt=8
Please suggest me, which api's i have to look into? Any tutorials avilable?
Thanks in advace.
You want to be looking into the UIProgressBar
object, and the related delegate methods. When you open a NSURLConnection
, you can retrieve the expected size of the thing you are downloading (this method will vary depending on where your data is coming from).
The NSURLConnection
will download the object in chunks, calling the didReciveData
method every time it receives a packet of bytes. Here you can calculate the percentage of the file downloaded (it will be decimal format, ie. 0.74/1.0) as you append the data and update the progress bar accordingly.
Check out the tutorial HERE
精彩评论