Created
February 26, 2013 01:39
-
-
Save romyilano/5035048 to your computer and use it in GitHub Desktop.
Apple Code
Adding data to a cell using tags
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/tableview_iphone/TableViewCells/TableViewCells.html
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:@"MyIdentifier"]; | |
| UILabel *label; | |
| label = (UILabel *)[cell viewWithTag:1]; | |
| label.text = [NSString stringWithFormat:@"%d", indexPath.row]; | |
| label = (UILabel *)[cell viewWithTag:2]; | |
| label.text = [NSString stringWithFormat:@"%d", NUMBER_OF_ROWS - indexPath.row]; | |
| return cell; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment