Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scottmkroberts/2938847 to your computer and use it in GitHub Desktop.
Save scottmkroberts/2938847 to your computer and use it in GitHub Desktop.
UITableView Snippet
#pragma mark - Table View Data Source
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
return cell;
}
#pragma mark - Table View Delegate
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment