I'm importing a large amount of Data into CoreData. I want to show a progressBar for the progress of importing.
First I'm showing the progress bar. Then I'm counting the data I want to import. Then I setup a for loop:
- in this for loop I first set the coreData object.
- then i'm incrementing the progress view.
After this loop I'm saving the coreData object and hiding the progressBar.
[self.progressView show];
int allFiles = [file count];
int currentFile = 1;
for(NSString *trackid in file) {
[entidyDesc setName:[track objectForKey:@"theKey"]];
float progress = [self convertAmountForProgressBar:currentFile maxNum:allFiles];
self.progressView.progressBar.progress = progress;
}
[self.progressView hide];
[self.managedObjectContext save:nil];
(simplified)
The problem is, the progressBar is not updating. It showing, but gets updated first after the for loop is completed and than its hiding. So, the progress bar is only showing up short after the for loop.
Any ideas how to solve this problem?