I’m trying to change the accessory view of a UITableViewCell when its row is selected, I have the following code:
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell* cell = [self tableView:aTableView cellForRowAtIndexPath:indexPath];
UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
[activityView startAnimating];
cell.accessoryView = activityView;
[activityView release];
}
But this isn’t working. Any ideas?
You should not ask the tableview datasource (your self) for a cell. because this will create a new cell which is just not displayed.
replace
with