Skip to content

Instantly share code, notes, and snippets.

@jchudzynski
Created February 4, 2014 20:44
Show Gist options
  • Select an option

  • Save jchudzynski/8811963 to your computer and use it in GitHub Desktop.

Select an option

Save jchudzynski/8811963 to your computer and use it in GitHub Desktop.
Formatting table view's cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyReuseIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier];
}
// format the cell
cell.textLabel.text =@"";
cell.imageView.image =[UIImage imageNamed:@"icon"];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment