У меня есть один вид таблицы, и в этом представлении таблицы у меня есть один идентификатор UIActivityIndicator с одной кнопкой в каждой ячейке. Теперь, щелкнув по этой кнопке, я хочу начать анимацию ActivityIndicator, ее запуск. Но проблема в том, что когда я просматриваю табличное представление, он прекращает анимацию. Вот мой код для cellForRowAtIndexPath
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"txDevicesListCellID"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"txDevicesListCellID"];
}
UIButton *buttonutton = (UIButton *)[cell viewWithTag:103];
UIActivityIndicatorView *activityIndicator = (UIActivityIndicatorView *) [cell viewWithTag:104];
button.tag = indexPath.row;
return cell;
}
и метод выбора для моей кнопки
-(IBAction)recevierButtonClick:(id)sender{
UIButton *button = (UIButton *)sender;
NSInteger index = button.tag;
NSIndexPath* indexpath = [NSIndexPath indexPathForRow:serialNumber inSection:0];
UITableViewCell* cell = [self.myTableView cellForRowAtIndexPath:indexpath];
activityIndicator = (UIActivityIndicatorView*)[cell viewWithTag:index];
[activityIndicator startAnimating];
}