I have a setup with three different UIWebViews which loads data from the internet. The time it takes for them to finish differs of course and the order they are finishing also.
They start their loading something like this (separate threads…):
- (void)update {
[spinner startAnimating];
[self performSelectorInBackground:@selector(webView1) withObject:nil];
[self performSelectorInBackground:@selector(webView2) withObject:nil];
[self performSelectorInBackground:@selector(webView3) withObject:nil];
}
And when the first one is finished it stops the spinner:
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[spinner stopAnimating];
}
I want the spinner to stop when all three UIWebViews are done with their loading. How do I manage that in a simple way?
This did work (sort of…)
But some few times the spinner stops before all three webviews have finished loading. I guess its because the some of my process that should start the webviews hasn’t started the webview yet. Therefore the if-statement could be true anyway if one process is much slower than another one… Hmm, I need some check that my processes are not running. Any ideas?