Created
February 27, 2013 03:41
-
-
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
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
| -(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