I have an action that can take a second or two when a row is selected in a UITableViewCell. I want to give the user feedback when they select the cell that I'm doing something. Currently it just shows the tableviewcell highlight. I added a UIActivityIndicatorView to my view. I have it hidden by default. I try to do this in my didSelectRowAtIndexPath:
{
CustomCell *cell = (CustomCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.activityIndicator.hidden = NO;
[cell.activityIndicator startAnimating];
// do long task
[cell.activityIndicator stopAnimating];
cell.activityIndicator.hidden = YES;
}
This code does not show my activityindicator. If I delete the
activityIndicator.hidden = YES;
in the
setCustomObject:(id)newObject
of my CustomCell class, I do see the indicator. It's just static though. I want to hide it until they click on the cell, animate while long task is running, then stop animating and hide again when long task is over. Any thoughts? Thanks!