My UITableView opens via PopOverViewController , so How can I load one of these cells automatically after app did load ,
the cell selecting process on MainViewContr
When you call selectRowAtIndexPath:animated:scrollPosition:
, tableView:didSelectRowAtIndexPath:
is not called on the delegate.
From the selectRowAtIndexPath:animated:scrollPosition: reference:
Calling this method does not cause the delegate to receive a tableView:willSelectRowAtIndexPath: or tableView:didSelectRowAtIndexPath: message, nor will it send UITableViewSelectionDidChangeNotification notifications to observers.
So, instead of just calling selectRowAtIndexPath:animated:scrollPosition:
:
[myTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];
you could call the delegate methods manually:
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
if ([myTableView.delegate respondsToSelector:@selector(tableView:willSelectRowAtIndexPath:)]) {
[myTableView.delegate tableView:self.tableView willSelectRowAtIndexPath:indexPath];
}
[myTableView selectRowAtIndexPath:indexPath animated:YES scrollPosition: UITableViewScrollPositionNone];
if ([myTableView.delegate respondsToSelector:@selector(tableView:didSelectRowAtIndexPath:)]) {
[myTableView.delegate tableView:self.tableView didSelectRowAtIndexPath:indexPath];
}