Skip to content

Instantly share code, notes, and snippets.

@lanqy
Last active January 3, 2016 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lanqy/8523817 to your computer and use it in GitHub Desktop.
Save lanqy/8523817 to your computer and use it in GitHub Desktop.
通过索引选中table cell
//select first row of first section
// from http://stackoverflow.com/questions/5918309/how-to-programmatically-tap-a-uitableview-cell
// from http://stackoverflow.com/questions/6118071/how-to-set-row-selected-by-default-in-uitableview
NSIndexPath* selectedCellIndexPath= [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView selectRowAtIndexPath:selectedCellIndexPath animated:false scrollPosition:UITableViewScrollPositionMiddle];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment