I have a UIProgressView that I'm using to visually represent a one-minute timer. Its width is 280 pixels. I'm using NSTimer to gradually decrease the value of 'progress', starting at progress=1.0. 'Progress' gets updated once every tenth of a second. For all but the final two seconds, it does exactly what I want it to.
Once the value of 'progress' goes below 0.03, the movement of the UIProgressView stops (showing about .2cm of bar) until 'progress' reaches 0.0, at which point the .2cm of bar simply disappears.
Does anyone know why UIProgressView is behaving this way? Is this by design, or am I doing something incorrectly?
edit:
mjdth,
I don't think it has to do with rounding, since in the method that NSTimer calls, I'm using NSLog to show the value of 'progress', and it gets printed with six significant digits, e.g.
2009-12-31 21:13:22.462 XXXXXXX 0.101669
2009-12-31 21:13:22.562 XXXXXXX 0.100003
Besides, if that were the case, all of the movement would be choppy, not just the last two seconds. Here is the code that NSTimer calls:
- (void) updateProgressBar {
timerProgressBar.progress = [playEndTime timeIntervalSinceNow] / 60.0;
NSLog(@"%f", timerProgressBar.progress);
}