Я построил простой стол с дополнительным видом для каждой строки. Я добавил uisearchcontroller. Каждый раз, когда я ищу объект, а затем выбираю вид аксессуара для этого объекта, изображение вспомогательного представления не обновляется.ViewView AccessView ViewView View не обновляется
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
UIButton *button = (UIButton *)cell.accessoryView;
UIImage *Image;
Image = [UIImage imageNamed:@"unchecked.png"];
[button setBackgroundImage:Image forState:UIControlStateNormal]; }
После того, как я отменил поиск, для строк, которые я искал, отображаются галочки (вид аксессуаров).
Это ваш весь столПросмотр: аксессуарыButtonTappedForRowWithIndexPath :? Где определена переменная ячейки? –
'if (self.searchDisplayController.searchBar.text.length> 0) { stringxyz = [searchResults objectAtIndex: indexPath.row]; } else { stringxyz = [self.someArray objectAtIndex: indexPath.row]; } NSIndexPath * indexValue = [NSIndexPath indexPathForRow: [self.someArray indexOfObject: stringxyz] inSection: 0]; \t UITableViewCell * cell = [self.tableView cellForRowAtIndexPath: indexValue]; ' – CarlosSantos
Решение найдено. http://stackoverflow.com/questions/11352403/reloading-searchresultstableview – CarlosSantos