Created
August 26, 2013 15:12
-
-
Save indyfromoz/6342520 to your computer and use it in GitHub Desktop.
Selecting a row of a UITableView after it is loaded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The performSelection: method is a "hack". The default row should be selected | |
// after the last row is selected in the table view | |
- (void)viewWillAppear:(BOOL)animated | |
{ | |
[super viewWillAppear:animated]; | |
[self performSelector:@selector(selectDefaultTableRow) withObject:nil afterDelay:0.5]; | |
} | |
- (void)selectDefaultTableRow | |
{ | |
[self.reportSummaryTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone]; | |
[self.reportSummaryTableView.delegate tableView:self.reportSummaryTableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment