Skip to content

Instantly share code, notes, and snippets.

@keicoder
Created February 7, 2014 03:56
Show Gist options
  • Select an option

  • Save keicoder/8857174 to your computer and use it in GitHub Desktop.

Select an option

Save keicoder/8857174 to your computer and use it in GitHub Desktop.
objective-c : 테이블 뷰 레이블 (not embeded lable) tag 설정
//테이블 뷰 레이블 (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