Skip to content

Instantly share code, notes, and snippets.

@brysonian
Created July 25, 2013 21:29
Show Gist options
  • Save brysonian/6083945 to your computer and use it in GitHub Desktop.
Save brysonian/6083945 to your computer and use it in GitHub Desktop.
UITableViewDataSource boilerplate methods
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
return self.items.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellId = @"SimpleCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:cellId];
}
// Configure the cell...
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment