Manually call a TableView cell

I need to manually programmatically initiate cell selection on my TableView. Essentially, a preliminary function is performed.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 

I do this so that when an item is deleted from the View table, it automatically loads the next item. However, when I try to manually call this function, it cannot be found. I tried

 self.tableView: didSelectRowAtIndexPath 

and

 [tableView didSelectRowAtIndexPath] 

but not recognized.

+6
source share
2 answers
 [self tableView:self.tableView didSelectRowAtIndexPath:selectedIndexPath]; 

replace selectedIndexPath with any next line

make sure self is your table view delegate

edit: I know this is an old question, but actually it needs to be done using [tableView selectRowAtIndexPath:path animated:YES scrollPosition:UITableViewScrollPositionMiddle];

+5
source

You must try:

 [self tableView:self.tableView didSelectRowAtIndexPath:YourIndexPath] 
+1
source

Source: https://habr.com/ru/post/921491/


All Articles