I want to display data into table view cell , how I can achive this. Please help me
-(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;
}
Please Help me.
Apart from reading this: http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7
Try to study how the interface builder/storyboard can help you, setting IBOutlets instead of trying access them using
[cell viewWithTag:3]. Using IBOutlets you can just refer to them by name, like:Now for the date you better read about
NSDateandNSDateFormatter🙂