I am trying to increment progress bar and show percentage on a label. However, both remains without changes when “incrementaProgres” function is called. IBOutlets are properly linked on xib and also tested that, when function is called, variables have proper value. Thanks
from delegate:
loadingViewController *theInstanceP = [[loadingViewController alloc] init];
[theInstanceP performSelectorOnMainThread:@selector(incrementaProgres:) withObject:[NSNumber numberWithFloat:0.15] waitUntilDone:YES];
loadingView class:
- (void)viewDidLoad
{
[super viewDidLoad];
[spinner startAnimating];
[progress setProgress:0.0];
}
- (void)incrementaProgres: (CGFloat)increment{
[progress setProgress:(progresInc + increment)];
carrega.text = [NSString stringWithFormat: @"%f", (progresInc + increment)];
}
Progress bar’s progress value is between
0.0and1.0, your code sets it in the increments of15.0, which is out of range. Your increment should be0.15, not15.0.