I have implemented a custom table view cell. I can get the cell to load, that is not the issue. What I am struggling with is setting the text property of the label. My code is below, what am I doing wrong?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
[self.icaoLabel setTag: 1];
[self.nameLabel setTag: 2];
[self.tafLabel setTag: 3];
[self.metarLabel setTag: 4];
static NSString *CellIdentifier = @"customCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed: @"TAFandMETARCustomCell" owner: self options: nil];
cell = customCell;
self.customCell = nil;
}
// Configure the cell...
TAFandMETAR *taf = (TAFandMETAR *)[tafAndMETARs objectAtIndex: indexPath.row];
//cell.textLabel.text = [dateFormatter stringFromDate: [taf creationDate]];
UILabel *label;
label = (UILabel *)[cell viewWithTag: 1];
label.text = [taf icaoCode];
label = (UILabel *)[cell viewWithTag: 2];
label.text = [taf airfieldName];
label = (UILabel *)[cell viewWithTag: 3];
label.text = [taf taf];
label = (UILabel *)[cell viewWithTag: 4];
label.text = [taf metar];
return cell;
}
Thanks.