Created
February 7, 2014 03:56
-
-
Save keicoder/8857174 to your computer and use it in GitHub Desktop.
objective-c : 테이블 뷰 레이블 (not embeded lable) tag 설정
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
| //테이블 뷰 레이블 (not embeded lable) tag 설정 | |
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ChecklistItem"]; | |
| //tag 값으로 지정하기 | |
| UILabel *label = (UILabel *)[cell viewWithTag:1000]; | |
| if (indexPath.row == 0) { | |
| label.text = @"Walk the dog"; | |
| } else if (indexPath.row == 1) { | |
| label.text = @"Brush my teeth"; | |
| } else if (indexPath.row == 2) { | |
| label.text = @"Learn iOS development"; | |
| } else if (indexPath.row == 3) { | |
| label.text = @"Soccer practice"; | |
| } else if (indexPath.row == 4) { | |
| label.text = @"Eat ice cream"; | |
| } | |
| return cell; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment