The Popover is a UITableViewController
, and the table-cell's class is a customize class 'MyOptionsTableViewCell', which has four UILabel
.
When the table load and called cellForRowAtIndexPath
method, I want to bind the customize data, but the code is not work.
The Code is:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"OptionCell";
MyOptionsTableViewCell *cell =(MyOptionsTableViewCell*) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell =[[MyOptionsTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
ProdOption *currentOption = [self.options objectAtIndex:indexPath.row];
//This four line code not work
cell.lblTitle.text = currentOption.Title;
cell.lblPoints.text = currentOption.Dig;
cell.lblStatus.text = currentOption.Status;
cell.lblDescription.text = currentOption.Description;
//This lines code worked well
//cell.textLabel.text = currentOption.Title;
return cell;
}