Hey Guys,
I have a table the starts an UIActivityIndicatorView (spinner) while an new view is being pushed based on a selected row. My app uses a navigation structure so when I press the back button my UIActivityIndicatorView (spinner) is still spinning.
How would I go about stopping this spinner when I navigate back to it?
Here is my code:
.m file where the spinner starts based on a row selection while pushing a new view:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
[progressInd setHidesWhenStopped:YES];
[progressInd stopAnimating];
}
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
self.hidesBottomBarWhenPushed = YES;
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if ([[fromPumpList objectAtIndex:indexPath.row] isEqual:@"One Hose Size"])
{
HandlinesViewController3 *detail = [[HandlinesViewController3 alloc] initWithNibName:@"HandlinesViewController3" bundle:nil];
[detail setTitle:@"Discharge Pressure"];
[self.navigationController pushViewController:detail animated:YES];
[progressInd startAnimating];
} }
The code above does work to show the spinner.
The problem is when I navigate back to the view and the spinner is still spinning.
I have spent about an hour and a half trying to find an example to help me. I am still learning so if you have the time please help me place my stopAnimating code in the right place.
Thanks,
Rob