Skip to content

Instantly share code, notes, and snippets.

@romyilano
Created February 27, 2013 03:41
Show Gist options
  • Select an option

  • Save romyilano/5044841 to your computer and use it in GitHub Desktop.

Select an option

Save romyilano/5044841 to your computer and use it in GitHub Desktop.
using tags without any need for subclassing a UITableViewCell - UITableView in iOS apress.com
-(UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
UILabel *cellLabel;
cellLabel = (UILabel *)[cell viewWithTag:1000];
cellLabel.text = [tableData objectAtIndex:indexPath.row];
UIImageView *cellIcon = (UIImageView *)[cell viewWithTag:1010];
cellIcon.image = [UIImage imageNamed:@"cellIcon"];
UIImageView *cellBackground = (UIImageView *)[cell viewWithTag:1020];
cellBackground.image = [UIImage imageNamed:@"cellBackground"];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment