0

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;
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Sandy Zheng
  • 13
  • 1
  • 4
  • What do you mean, it doesn't work? What do you see? Do you get any errors? – rdelmar Jul 11 '13 at 04:37
  • Hi rdelmar, sorry for my poor English. Now, I have find the cause: http://stackoverflow.com/questions/9797821/keep-getting-nil-from-dequeuereusablecellwithidentifier. And then , i will create UIlable dynamic. Thanks a lot. – Sandy Zheng Jul 11 '13 at 07:47

0 Answers0