Search code examples
iphonecocoa-touchios4ipad

How to programmatically "tap" a UITableView cell?


I was wondering is there a way that I could have my code "tap" a cell in my UITableView in order to reproduce the behaviour specified in the - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath delegate method.

I guess in other words, is is possible to invoke the - (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath delegate method programatically?


Solution

  • Can't you put any logic in didSelectRowAtIndexPath into a separate method and just call that method from both didSelectRowAtIndexPath and wherever else you want to call the same code?