Question

I did a search and found all sorts of things on this forum about NSProgressIndicator, but alas nothing which helps me specifically. It seems like a popular topic though. Here's my problem. Up until today, my determinate bar indicator was working fine but all of a sudden, it just stopped animating after running smoothly the first time through. Here is my code

-(void) someMethod;    
{
    // Setup the progress indicator 
    double progressValue = 0.0;
    [self.progressBar setBezeled:YES];
    [self.progressBar setDoubleValue:progressValue];
    [self.progressBar setMaxValue: (double) maxCount];

    for(int i=0, i<=maxCount-1; i++)
    {
       ///Lots of stuff in the loop

       // Increment progressIndicator
       progressValue +=1;
       [self.progressBar setHidden:NO];
       [self.progressBar setDoubleValue: progressValue];
       NSLog(@"%f",[self.progressBar doubleValue]);
       [self.progressBar displayIfNeeded];
     }

     [self.progressBar setHidden:YES];
}

Please note that I explicitly use setHidden:YES and setHidden:NO because I already couldn't get the displayWhenStopped to work correctly. When I check the actual value of progressBar.doubleValue in the log it does increment as it should to the incremented values. It really seems as if the displayIfNeeded method just stopped working all of a sudden. Like I said, it works correctly the first time through, then after that it displays the bar, increments once or twice, then gets stuck. The rest of the code and loop continue just fine and completes itself.

Does anyone have any ideas or clues?? I suspect it may have something to do with threads which I know nothing about. Any help would be great. Thanks in advance for any help!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top