我想在表格视图单元格中显示数据,我如何完成此操作。请帮我如何在表格视图单元格中显示数据
-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *feedsTableIdentifier = @"FeedsTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:feedsTableIdentifier];
if (cell==nil) {
[[NSBundle mainBundle] loadNibNamed:@"FeedsTableViewCell" owner:self options:nil];
cell=tableViewCell;
self.tableViewCell=nil;
}
title=(UILabel *)[cell viewWithTag:1];
title.text=[NSString stringWithFormat:@"%d",indexPath.row];
postedBy=(UILabel*)[cell viewWithTag:2];
postedBy.text=[NSString stringWithFormat:@"%d",indexPath.row];
onDate = (UILabel *)[cell viewWithTag:3];
onDate.text=[NSString stringWithFormat:@"%d",indexPath.row];
return cell;
}
请帮帮我。
你是什么意思显示数据? – 2012-04-25 13:22:07
你想要什么..这是你的代码,或者你只是举了例子来显示你想要显示的这种类型的数据 – Hiren 2012-04-25 13:35:59
我想设置title,postingby和ondate的值。这些是tableviewcell上的标签 – Pradeep 2012-04-25 13:36:44