Last active
July 26, 2017 06:47
-
-
Save lennypham/5215973 to your computer and use it in GitHub Desktop.
Table View Controller Delegate and Datasource methods
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
#pragma mark - Table view data source | |
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView | |
{ | |
#warning Potentially incomplete method implementation. | |
// Return the number of sections. | |
return 0; | |
} | |
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section | |
{ | |
#warning Incomplete method implementation. | |
// Return the number of rows in the section. | |
return 0; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"Cell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; | |
// Configure the cell... | |
return cell; | |
} | |
#pragma mark - Table view delegate | |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
// Navigation logic may go here. Create and push another view controller. | |
/* | |
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; | |
// ... | |
// Pass the selected object to the new view controller. | |
[self.navigationController pushViewController:detailViewController animated:YES]; | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment