Im updating a UIProgressView called “ammo”. When i update the progress the UIProgressView disappears from the UIView like its being hidden or moved behind another view.
Code
- (void)updateAmmo:(float) inputAmmo capacity:(float)inputCapacity{
//Calculate the progress value
float value = inputAmmo/inputCapacity;
//If nothing has changed don’t update
if(value != ammo.progress){
[ammo setProgress:value];
}
}
Things I have checked
- Checked to see if it is being hidden.
- Brought the UIProgressView to the front.
- Tried [ammo setProgress: ammo.progress-0.01]; this breaks it aswell
- Inserting a value directly works [ammo setProgress: 0.950000];
- Tried adding [ammo setNeedsDisplay];
Logging value extracts
- 2011-07-23 15:15:34.659 XXXXXXX[2399:207] value - 1.000000
- 2011-07-23 15:15:34.659 XXXXXXX[2399:207] value - 0.950000
- 2011-07-23 15:15:34.712 XXXXXXX[2399:207] value - 0.900000
Thanks in advance for any assistance.