0

i have a problem that the content-length of header is undetermined ie -1 in my case. So can anyone please give me an idea on how to calculate the progress for the progress view, so that i display the progress view as the page loads.. .. thanks in advance!! :

Zaraki
  • 3,720
  • 33
  • 39

2 Answers2

1

There isn't a way to. In a webbrowser they usually say '33k of unknown' or show a ajax-y spinner

Bruce Aldridge
  • 2,907
  • 3
  • 23
  • 30
1

It's impossible by definition. If you don't know how big IT is, you can't know how much of IT you now have or how much of IT there still is.

Roger
  • 15,793
  • 4
  • 51
  • 73
  • is there somehow any way to create an indeterminate progress bar, or am i silly asking it again?? :D – Zaraki Apr 18 '11 at 10:24
  • You can create the progress bar (see the class reference for UIProgressView) but that won't help the user as you have no meaningful way of updating it. It will either reach the end too soon and then appear to hang at 100% or it will only reach part way across the screen before the whole file has arrived. Better to use UIActivityView instead to show a spinner and perhaps show how much (in absolute terms) of the file has arrived. If you have control of the server, then obviously fixing that so it does return the correct content length would be a better starting point. – Roger Apr 18 '11 at 11:25