I have used the following code to programmatically select tableview cells
- (void) selectTableCell{
NSIndexPath *ip = [NSIndexPath indexPathForRow:0 inSection:0];
[tableView selectRowAtIndexPath:ip animated:YES scrollPosition:UITableViewScrollPositionBottom];
NSIndexPath *ip1 = [NSIndexPath indexPathForRow:1 inSection:0];
[tableView selectRowAtIndexPath:ip1 animated:YES scrollPosition:UITableViewScrollPositionBottom];}
For testing purposes I wanted to do this. How do I generate the didselect event?
The documentation explicitly tells you what happens:
You could try to call these methods yourself but you are not guaranteed that will replicate the original functionality.
To test your UI, you should probably use the Instruments-based UI Automation Testing if possible.