views:

31

answers:

1

Hi there

I am downloading video files over wifi through my application to the iphone.

I want to make a % downloaded display (eg: loading bar style).

I thought about using - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data; but I would need to know how much data there was overall to download.

Is there any way to make a "download status" bar?

Thanks

+2  A: 

You can get expected contents length in didRecieveResponse delegate method (using expectedContentLength in NSURLResponse)

then in -didReceiveData you get the length of data already downloaded and calculate progress percentage from it.

Vladimir
You are a genius. :)
Thomas Clayson