开发者

iPhone Download Meter

开发者 https://www.devze.com 2023-02-05 04:28 出处:网络
Hi i have plan to develop app similar to http://itunes.apple.com/app开发者_如何学JAVA/download-meter-for-wi-fi-3g/id327227530?mt=8

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号