Como Jaanus dijo:
Al llamar a este (-selectRowAtIndexPath: animada: Método scrollPosition :) no causa el delegado para recibir una tableView : willSelectRowAtIndexPath: o tableView: didSelectRowAtIndexPath: message, ni enviará UITableViewSelectionDidChangeNotification notificaciones a los observadores.
Así que solo tiene que llamar al método delegate
usted mismo.
Por ejemplo:
Swift 3 version:
let indexPath = IndexPath(row: 0, section: 0);
self.tableView.selectRow(at: indexPath, animated: false, scrollPosition: UITableViewScrollPosition.none)
self.tableView(self.tableView, didSelectRowAt: indexPath)
ObjectiveC versión:
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:1 inSection:0];
[self.tableView selectRowAtIndexPath:indexPath
animated:YES
scrollPosition:UITableViewScrollPositionNone];
[self tableView:self.tableView didSelectRowAtIndexPath:indexPath];
Swift 2.3 Versión:
let indexPath = NSIndexPath(forRow: 0, inSection: 0);
self.tableView.selectRowAtIndexPath(indexPath, animated: false, scrollPosition: UITableViewScrollPosition.None)
self.tableView(self.tableView, didSelectRowAtIndexPath: indexPath)
Me encontré con el mismo problema y acabo de corregir el enlace: http://stackoverflow.com/questions/5324501/select-tableviews-row-from-an-another-view Espero que sea útil para usted. – michael